Exemple #1
0
def register_text_sensor(var, config):
    if not CORE.has_id(config[CONF_ID]):
        var = Pvariable(config[CONF_ID], var, has_side_effects=True)
    add(App.register_text_sensor(var))
    CORE.add_job(setup_text_sensor_core_, var, config)
Exemple #2
0
def setup_binary_sensor(binary_sensor_obj, config):
    if not CORE.has_id(config[CONF_ID]):
        binary_sensor_obj = Pvariable(config[CONF_ID],
                                      binary_sensor_obj,
                                      has_side_effects=True)
    CORE.add_job(setup_binary_sensor_core_, binary_sensor_obj, config)
Exemple #3
0
def setup_text_sensor(text_sensor_obj, config):
    if not CORE.has_id(config[CONF_ID]):
        text_sensor_obj = Pvariable(config[CONF_ID],
                                    text_sensor_obj,
                                    has_side_effects=True)
    CORE.add_job(setup_text_sensor_core_, text_sensor_obj, config)
Exemple #4
0
def setup_switch(switch_obj, config):
    if not CORE.has_id(config[CONF_ID]):
        switch_obj = Pvariable(config[CONF_ID],
                               switch_obj,
                               has_side_effects=True)
    CORE.add_job(setup_switch_core_, switch_obj, config)