diff --git a/custom_components/echonetlite/__init__.py b/custom_components/echonetlite/__init__.py index 0619f5e..e652bd8 100644 --- a/custom_components/echonetlite/__init__.py +++ b/custom_components/echonetlite/__init__.py @@ -169,6 +169,10 @@ def unload_config_entry(): ) if server._state.get(host): server._state.pop(host) + # Remove update callback function + for _key in list(server._update_callbacks.keys()): + if _key.startswith(host): + del server._update_callbacks[_key] entry.async_on_unload(unload_config_entry)