Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion homeassistant/components/sensor/rflink.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ def devices_from_config(domain_config, hass=None):
device = RflinkSensor(device_id, hass, **config)
devices.append(device)

# Register entity to listen to incoming rflink events
# Register entity (and aliases) to listen to incoming rflink events
hass.data[DATA_ENTITY_LOOKUP][
EVENT_KEY_SENSOR][device_id].append(device)
aliases = config.get(CONF_ALIASES)
if aliases:
for _id in aliases:
hass.data[DATA_ENTITY_LOOKUP][
EVENT_KEY_SENSOR][_id].append(device)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be refactored to use our dispatch helper instead. We should not store entities in a shared dictionary in hass.data. Entities should only be accessed directly from within their own platform.

return devices


Expand Down