Merge pull request #1646 from balloob/rfxtrx

Fixed bug in rfxtrx sensor
This commit is contained in:
Paulus Schoutsen committed 2016-03-31 22:12:04 -07:00
commit b063fa3165
2 files changed
+123 -1

No files matched your search

+7 -1
View File
@@ -39,7 +39,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
event = rfxtrx.get_rfx_object(entity_info[ATTR_PACKETID])
new_sensor = RfxtrxSensor(event, entity_info[ATTR_NAME],
entity_info.get(ATTR_DATA_TYPE, None))
rfxtrx.RFX_DEVICES[device_id] = new_sensor
rfxtrx.RFX_DEVICES[slugify(device_id)] = new_sensor
sensors.append(new_sensor)
add_devices_callback(sensors)
@@ -53,6 +53,12 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
if device_id in rfxtrx.RFX_DEVICES:
rfxtrx.RFX_DEVICES[device_id].event = event
k = 2
_device_id = device_id + "_" + str(k)
while _device_id in rfxtrx.RFX_DEVICES:
rfxtrx.RFX_DEVICES[_device_id].event = event
k = k + 1
_device_id = device_id + "_" + str(k)
return
# Add entity if not exist and the automatic_add is True