UniFi - Improve controller tests (#27261)

* Improve controller tests and harmonize setup_unifi_integration to one
* Store listeners to dispatchers to be used during reset
This commit is contained in:
Robert Svensson
2019-10-07 21:55:35 +02:00
committed by GitHub
parent 1febb32dd9
commit 6565c17828
10 changed files with 401 additions and 583 deletions

View File

@@ -53,7 +53,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Update the values of the controller."""
update_items(controller, async_add_entities, switches, switches_off)
async_dispatcher_connect(hass, controller.signal_update, update_controller)
controller.listeners.append(
async_dispatcher_connect(hass, controller.signal_update, update_controller)
)
update_controller()
switches_off.clear()