Skip to content

Commit

Permalink
Remove update callback function on unload_config_entry()
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Mar 19, 2024
1 parent 73d532e commit 9f50c1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/echonetlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9f50c1b

Please sign in to comment.