Use config_entry.on_unload rather than local listener implementation in UniFi (#49496)
This commit is contained in:
parent
138226fa14
commit
63616a9e36
5 changed files with 9 additions and 11 deletions
|
@ -41,7 +41,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
add_uptime_entities(controller, async_add_entities, clients)
|
||||
|
||||
for signal in (controller.signal_update, controller.signal_options_update):
|
||||
controller.listeners.append(async_dispatcher_connect(hass, signal, items_added))
|
||||
config_entry.async_on_unload(
|
||||
async_dispatcher_connect(hass, signal, items_added)
|
||||
)
|
||||
|
||||
items_added()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue