コード例 #1
0
ファイル: rdm6300.py プロジェクト: yottatsa/esphomeyaml
def to_code(config):
    for uart_ in get_variable(config[CONF_UART_ID]):
        yield
    rhs = App.make_rdm6300_component(uart_)
    var = Pvariable(config[CONF_ID], rhs)
    setup_component(var, config)
コード例 #2
0
ファイル: automation.py プロジェクト: yottatsa/esphomeyaml
def component_update_action_to_code(config, action_id, arg_type, template_arg):
    for var in get_variable(config[CONF_ID]):
        yield None
    rhs = UpdateComponentAction.new(var)
    type = UpdateComponentAction.template(template_arg)
    yield Pvariable(action_id, rhs, type=type)
コード例 #3
0
ファイル: automation.py プロジェクト: yottatsa/esphomeyaml
def or_condition_to_code(config, condition_id, arg_type, template_arg):
    for conditions in build_conditions(config, arg_type):
        yield
    rhs = OrCondition.new(template_arg, conditions)
    type = OrCondition.template(template_arg)
    yield Pvariable(condition_id, rhs, type=type)
コード例 #4
0
ファイル: automation.py プロジェクト: yottatsa/esphomeyaml
def lambda_condition_to_code(config, condition_id, arg_type, template_arg):
    for lambda_ in process_lambda(config, [(arg_type, 'x')]):
        yield
    rhs = LambdaCondition.new(template_arg, lambda_)
    type = LambdaCondition.template(template_arg)
    yield Pvariable(condition_id, rhs, type=type)
コード例 #5
0
def register_text_sensor(var, config):
    text_sensor_var = Pvariable(config[CONF_ID], var, has_side_effects=True)
    rhs = App.register_text_sensor(text_sensor_var)
    mqtt_var = Pvariable(config[CONF_MQTT_ID], rhs, has_side_effects=True)
    CORE.add_job(setup_text_sensor_core_, text_sensor_var, mqtt_var, config)