Add signal repetition to rfxtrx
This commit is contained in:
parent
0010cadd39
commit
b93ebe1936
2 changed files with 12 additions and 7 deletions
|
@ -43,8 +43,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
|
||||
rfxobject = rfxtrx.get_rfx_object(entity_info[ATTR_PACKETID])
|
||||
new_light = RfxtrxLight(
|
||||
entity_info[ATTR_NAME], rfxobject, datas, signal_repetitions
|
||||
)
|
||||
entity_info[ATTR_NAME], rfxobject, datas,
|
||||
signal_repetitions)
|
||||
rfxtrx.RFX_DEVICES[entity_id] = new_light
|
||||
lights.append(new_light)
|
||||
|
||||
|
@ -72,8 +72,10 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
pkt_id = "".join("{0:02x}".format(x) for x in event.data)
|
||||
entity_name = "%s : %s" % (entity_id, pkt_id)
|
||||
datas = {ATTR_STATE: False, ATTR_FIREEVENT: False}
|
||||
signal_repetitions = config.get('signal_repetitions', SIGNAL_REPETITIONS)
|
||||
new_light = RfxtrxLight(entity_name, event, datas, signal_repetitions)
|
||||
signal_repetitions = config.get('signal_repetitions',
|
||||
SIGNAL_REPETITIONS)
|
||||
new_light = RfxtrxLight(entity_name, event, datas,
|
||||
signal_repetitions)
|
||||
rfxtrx.RFX_DEVICES[entity_id] = new_light
|
||||
add_devices_callback([new_light])
|
||||
|
||||
|
|
|
@ -43,7 +43,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
|
||||
rfxobject = rfxtrx.get_rfx_object(entity_info[ATTR_PACKETID])
|
||||
newswitch = RfxtrxSwitch(
|
||||
entity_info[ATTR_NAME], rfxobject, datas, signal_repetitions)
|
||||
entity_info[ATTR_NAME], rfxobject, datas,
|
||||
signal_repetitions)
|
||||
rfxtrx.RFX_DEVICES[entity_id] = newswitch
|
||||
switchs.append(newswitch)
|
||||
|
||||
|
@ -71,8 +72,10 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
pkt_id = "".join("{0:02x}".format(x) for x in event.data)
|
||||
entity_name = "%s : %s" % (entity_id, pkt_id)
|
||||
datas = {ATTR_STATE: False, ATTR_FIREEVENT: False}
|
||||
signal_repetitions = config.get('signal_repetitions', SIGNAL_REPETITIONS)
|
||||
new_switch = RfxtrxSwitch(entity_name, event, datas, signal_repetitions)
|
||||
signal_repetitions = config.get('signal_repetitions',
|
||||
SIGNAL_REPETITIONS)
|
||||
new_switch = RfxtrxSwitch(entity_name, event, datas,
|
||||
signal_repetitions)
|
||||
rfxtrx.RFX_DEVICES[entity_id] = new_switch
|
||||
add_devices_callback([new_switch])
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue