mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Fix updates of Rssi for control devices in rfxtrx (#38131)
* Change entity to entity_info * Fix bug in RSSI for Control devices
This commit is contained in:
@@ -65,7 +65,7 @@ async def async_setup_entry(
|
||||
return isinstance(event, (ControlEvent, SensorEvent))
|
||||
|
||||
entities = []
|
||||
for packet_id, entity in discovery_info[CONF_DEVICES].items():
|
||||
for packet_id, entity_info in discovery_info[CONF_DEVICES].items():
|
||||
event = get_rfx_object(packet_id)
|
||||
if event is None:
|
||||
_LOGGER.error("Invalid device: %s", packet_id)
|
||||
@@ -73,7 +73,9 @@ async def async_setup_entry(
|
||||
if not supported(event):
|
||||
continue
|
||||
|
||||
device_id = get_device_id(event.device, data_bits=entity.get(CONF_DATA_BITS))
|
||||
device_id = get_device_id(
|
||||
event.device, data_bits=entity_info.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:
|
||||
@@ -169,9 +171,6 @@ class RfxtrxSensor(RfxtrxEntity):
|
||||
@callback
|
||||
def _handle_event(self, event, device_id):
|
||||
"""Check if event applies to me and update."""
|
||||
if not isinstance(event, SensorEvent):
|
||||
return
|
||||
|
||||
if device_id != self._device_id:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user