rfxtrx refactor
This commit is contained in:
parent
23db6e753f
commit
8ffa3684e3
3 changed files with 32 additions and 29 deletions
|
@ -29,7 +29,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
signal_repetitions = config.get('signal_repetitions', SIGNAL_REPETITIONS)
|
||||
|
||||
for device_id, entity_info in config.get('devices', {}).items():
|
||||
if device_id not in rfxtrx.RFX_DEVICES:
|
||||
if device_id in rfxtrx.RFX_DEVICES:
|
||||
continue
|
||||
_LOGGER.info("Add %s rfxtrx.light", entity_info[ATTR_NAME])
|
||||
|
||||
# Check if i must fire event
|
||||
|
|
|
@ -33,7 +33,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
|
||||
sensors = []
|
||||
for device_id, entity_info in config.get('devices', {}).items():
|
||||
if device_id not in rfxtrx.RFX_DEVICES:
|
||||
if device_id in rfxtrx.RFX_DEVICES:
|
||||
continue
|
||||
_LOGGER.info("Add %s rfxtrx.sensor", entity_info[ATTR_NAME])
|
||||
event = rfxtrx.get_rfx_object(entity_info[ATTR_PACKETID])
|
||||
new_sensor = RfxtrxSensor(event, entity_info[ATTR_NAME],
|
||||
|
|
|
@ -29,7 +29,8 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
|||
switchs = []
|
||||
signal_repetitions = config.get('signal_repetitions', SIGNAL_REPETITIONS)
|
||||
for device_id, entity_info in config.get('devices', {}).items():
|
||||
if device_id not in rfxtrx.RFX_DEVICES:
|
||||
if device_id in rfxtrx.RFX_DEVICES:
|
||||
continue
|
||||
_LOGGER.info("Add %s rfxtrx.switch", entity_info[ATTR_NAME])
|
||||
|
||||
# Check if i must fire event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue