Exemple #1
0
async def build_condition(full_config, template_arg, args):
    registry_entry, config = cg.extract_registry_entry_config(
        CONDITION_REGISTRY, full_config)
    action_id = full_config[CONF_TYPE_ID]
    builder = registry_entry.coroutine_fun
    ret = await builder(config, action_id, template_arg, args)
    return ret
Exemple #2
0
def build_binary_sensor(full_config):
    registry_entry, config = cg.extract_registry_entry_config(BINARY_SENSOR_REGISTRY, full_config)
    type_id = full_config[CONF_TYPE_ID]
    builder = registry_entry.coroutine_fun
    var = cg.new_Pvariable(type_id)
    yield cg.register_component(var, full_config)
    yield register_listener(var, full_config)
    yield builder(var, config)
    yield var
Exemple #3
0
def build_payload_setter(full_config, template_arg, args):
    registry_entry, config = cg.extract_registry_entry_config(
        PAYLOAD_SETTER_REGISTRY, full_config)
    builder = registry_entry.coroutine_fun
    yield builder(config, config[ehc.CONF_ID], template_arg, args)
Exemple #4
0
def build_action(full_config, template_arg, args):
    registry_entry, config = cg.extract_registry_entry_config(ACTION_REGISTRY, full_config)
    action_id = full_config[CONF_TYPE_ID]
    builder = registry_entry.coroutine_fun
    yield builder(config, action_id, template_arg, args)