mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Migrate rfxtrx to use run_immediately=True for the device registry listener (#115165)
This commit is contained in:
parent
2fc0d8494d
commit
266e4f0c8b
@ -281,7 +281,7 @@ async def async_setup_internal(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
|||||||
|
|
||||||
entry.async_on_unload(
|
entry.async_on_unload(
|
||||||
hass.bus.async_listen(
|
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:
|
if devices:
|
||||||
for event_code, options in devices.items():
|
for event_code, options in devices.items():
|
||||||
if options is None:
|
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:
|
else:
|
||||||
entry_data[CONF_DEVICES][event_code] = options
|
entry_data[CONF_DEVICES][event_code] = options
|
||||||
self.hass.config_entries.async_update_entry(self._config_entry, data=entry_data)
|
self.hass.config_entries.async_update_entry(self._config_entry, data=entry_data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user