diff --git a/homeassistant/components/light/rflink.py b/homeassistant/components/light/rflink.py index ad25ae6a38d..a36a4f43f22 100644 --- a/homeassistant/components/light/rflink.py +++ b/homeassistant/components/light/rflink.py @@ -162,8 +162,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): hass.data[DATA_ENTITY_LOOKUP][ EVENT_KEY_COMMAND][device_id].append(device) - # Make sure the event is processed by the new entity - device.handle_event(event) + # Schedule task to process event after entity is created + hass.async_add_job(device.handle_event, event) hass.data[DATA_DEVICE_REGISTER][EVENT_KEY_COMMAND] = add_new_device diff --git a/homeassistant/components/sensor/rflink.py b/homeassistant/components/sensor/rflink.py index 8f8ae769d0e..80a5b7dfb8d 100644 --- a/homeassistant/components/sensor/rflink.py +++ b/homeassistant/components/sensor/rflink.py @@ -88,8 +88,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): hass.data[DATA_ENTITY_LOOKUP][ EVENT_KEY_SENSOR][device_id].append(device) - # Make sure the event is processed by the new entity - device.handle_event(event) + # Schedule task to process event after entity is created + hass.async_add_job(device.handle_event, event) hass.data[DATA_DEVICE_REGISTER][EVENT_KEY_SENSOR] = add_new_device