Esempio n. 1
0
def to_code(config):
    ir = None
    for ir in get_variable(config[CONF_IR_TRANSMITTER_ID]):
        yield
    send_data = exp_send_data(config)
    rhs = App.register_component(ir.create_transmitter(config[CONF_NAME], send_data))
    switch.register_switch(rhs, config)
Esempio n. 2
0
def to_code(config):
    ir = get_variable(config.get(CONF_IR_TRANSMITTER_ID),
                      IRTransmitterComponent)
    send_data = exp_send_data(config)
    rhs = App.register_component(
        ir.create_transmitter(config[CONF_NAME], send_data))
    switch.register_switch(rhs, config)
Esempio n. 3
0
def to_code(config):
    ir = get_variable(config.get(CONF_IR_TRANSMITTER_ID), IR_TRANSMITTER_COMPONENT_CLASS)
    send_data = exp_send_data(config)
    rhs = ir.create_transmitter(config[CONF_NAME], send_data)
    switch_ = Pvariable(IR_TRANSMITTER_COMPONENT_CLASS + '::DataTransmitter', config[CONF_ID],
                        rhs)
    switch.register_switch(switch_, config)
Esempio n. 4
0
def to_code(config):
    for template_ in process_lambda(config[CONF_LAMBDA], [],
                                    return_type=std_vector.template(
                                        switch.SwitchPtr)):
        yield

    rhs = CustomSwitchConstructor(template_)
    custom = variable(config[CONF_ID], rhs)
    for i, sens in enumerate(config[CONF_SWITCHES]):
        switch.register_switch(custom.get_switch(i), sens)
Esempio n. 5
0
def to_code(config):
    for remote in get_variable(config[CONF_REMOTE_TRANSMITTER_ID]):
        yield
    rhs = transmitter_base(config)
    transmitter = Pvariable(config[CONF_TRANSMITTER_ID], rhs)

    if CONF_REPEAT in config:
        if isinstance(config[CONF_REPEAT], int):
            times = config[CONF_REPEAT]
            wait_us = 1000
        else:
            times = config[CONF_REPEAT][CONF_TIMES]
            wait_us = config[CONF_REPEAT][CONF_WAIT_TIME]
        add(transmitter.set_repeat(times, wait_us))

    switch.register_switch(remote.add_transmitter(transmitter), config)