From e8a0ba3ff47ee5c16974d19ded2598964b84c91e Mon Sep 17 00:00:00 2001 From: Ashley Gittins Date: Thu, 9 May 2024 17:34:09 +0000 Subject: [PATCH] fix: Resolve infinite loop on config reload in 2024.5 - Only showed up once on 2024.5.x, submitting new config caused infinite loop due to the listener not being un-subscribed when entry was unloaded. --- custom_components/bermuda/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/bermuda/__init__.py b/custom_components/bermuda/__init__.py index ee95a5c..8d73fbd 100644 --- a/custom_components/bermuda/__init__.py +++ b/custom_components/bermuda/__init__.py @@ -196,7 +196,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS) - entry.add_update_listener(async_reload_entry) + entry.async_on_unload(entry.add_update_listener(async_reload_entry)) return True