Use config_entry.on_unload rather than local listener implementation in Axis (#49495)

This commit is contained in:
Robert Svensson
2021-04-20 20:53:05 +02:00
committed by GitHub
parent 63616a9e36
commit 12a9695798
5 changed files with 5 additions and 10 deletions

View File

@@ -53,7 +53,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
):
async_add_entities([AxisBinarySensor(event, device)])
device.listeners.append(
config_entry.async_on_unload(
async_dispatcher_connect(hass, device.signal_new_event, async_add_sensor)
)