Exemplo n.º 1
0
def to_code(config):
    rhs = App.make_mqtt_subscribe_text_sensor(config[CONF_NAME],
                                              config[CONF_TOPIC])
    make = variable(config[CONF_MAKE_ID], rhs)
    sensor_ = make.Psensor

    if CONF_QOS in config:
        add(sensor_.set_qos(config[CONF_QOS]))

    text_sensor.setup_text_sensor(sensor_, make.Pmqtt, config)
    setup_component(sensor_, config)
Exemplo n.º 2
0
def to_code(config):
    rhs = App.make_template_text_sensor(config[CONF_NAME], config.get(CONF_UPDATE_INTERVAL))
    make = variable(config[CONF_MAKE_ID], rhs)
    template = make.Ptemplate_
    text_sensor.setup_text_sensor(template, make.Pmqtt, config)
    setup_component(template, config)

    for template_ in process_lambda(config[CONF_LAMBDA], [],
                                    return_type=optional.template(std_string)):
        yield
    add(template.set_template(template_))
Exemplo n.º 3
0
def to_code(config):
    rhs = App.make_version_text_sensor(config[CONF_NAME])
    make = variable(config[CONF_MAKE_ID], rhs)
    text_sensor.setup_text_sensor(make.Psensor, make.Pmqtt, config)
    setup_component(make.Psensor, config)
Exemplo n.º 4
0
def to_code(config):
    rhs = App.make_homeassistant_text_sensor(config[CONF_NAME],
                                             config[CONF_ENTITY_ID])
    make = variable(config[CONF_MAKE_ID], rhs)
    sensor_ = make.Psensor
    text_sensor.setup_text_sensor(sensor_, make.Pmqtt, config)