From 442eed0acfc3c420d9b0d651259433ecd25ae48b Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 26 May 2023 22:11:08 -0500 Subject: [PATCH] Disable call_soon for rfxtrx device registry updates Run rfxtrx device registry updates immediately without the call_soon delay. This listener does not need a delay and it only adds overhead in this case. --- homeassistant/components/rfxtrx/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/rfxtrx/__init__.py b/homeassistant/components/rfxtrx/__init__.py index de8a9fc6b8..e84ee14123 100644 --- a/homeassistant/components/rfxtrx/__init__.py +++ b/homeassistant/components/rfxtrx/__init__.py @@ -263,7 +263,9 @@ async def async_setup_internal(hass: HomeAssistant, entry: ConfigEntry) -> None: _remove_device(device_id) entry.async_on_unload( - hass.bus.async_listen(dr.EVENT_DEVICE_REGISTRY_UPDATED, _updated_device) + hass.bus.async_listen( + dr.EVENT_DEVICE_REGISTRY_UPDATED, _updated_device, run_immediately=True + ) ) def _shutdown_rfxtrx(event: Event) -> None: