Migrate rfxtrx to use run_immediately=True for the device registry listener (#115165)
This commit is contained in:
parent
2fc0d8494d
commit
266e4f0c8b
2 changed files with 5 additions and 2 deletions
|
@ -281,7 +281,7 @@ async def async_setup_internal(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
|||
|
||||
entry.async_on_unload(
|
||||
hass.bus.async_listen(
|
||||
dr.EVENT_DEVICE_REGISTRY_UPDATED, _updated_device, run_immediately=False
|
||||
dr.EVENT_DEVICE_REGISTRY_UPDATED, _updated_device, run_immediately=True
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -486,7 +486,10 @@ class RfxtrxOptionsFlow(OptionsFlow):
|
|||
if devices:
|
||||
for event_code, options in devices.items():
|
||||
if options is None:
|
||||
entry_data[CONF_DEVICES].pop(event_code)
|
||||
# If the config entry is setup, the device registry
|
||||
# listener will remove the device from the config
|
||||
# entry before we get here
|
||||
entry_data[CONF_DEVICES].pop(event_code, None)
|
||||
else:
|
||||
entry_data[CONF_DEVICES][event_code] = options
|
||||
self.hass.config_entries.async_update_entry(self._config_entry, data=entry_data)
|
||||
|
|
Loading…
Add table
Reference in a new issue