Fix issue with creation of PT2262 devices in rfxtrx integration (#38074)

This commit is contained in:
Rob Bierbooms
2020-07-23 00:09:37 +02:00
committed by GitHub
parent b15dad8c4b
commit 83a27f4855
5 changed files with 17 additions and 7 deletions

View File

@@ -14,6 +14,7 @@ from homeassistant.core import callback
from . import (
CONF_AUTOMATIC_ADD,
CONF_DATA_BITS,
DATA_TYPES,
SIGNAL_EVENT,
RfxtrxEntity,
@@ -64,7 +65,7 @@ async def async_setup_entry(
return isinstance(event, (ControlEvent, SensorEvent))
entities = []
for packet_id in discovery_info[CONF_DEVICES]:
for packet_id, entity in discovery_info[CONF_DEVICES].items():
event = get_rfx_object(packet_id)
if event is None:
_LOGGER.error("Invalid device: %s", packet_id)
@@ -72,7 +73,7 @@ async def async_setup_entry(
if not supported(event):
continue
device_id = get_device_id(event.device)
device_id = get_device_id(event.device, data_bits=entity.get(CONF_DATA_BITS))
for data_type in set(event.values) & set(DATA_TYPES):
data_id = (*device_id, data_type)
if data_id in data_ids: