Use async_on_unload in Netatmo (#58461)

This commit is contained in:
Tobias Sauerwein 2021-10-26 13:43:54 +02:00 committed by GitHub
parent e9ba5f3b4b
commit ac4496b985
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 22 deletions

View file

@ -152,7 +152,7 @@ class NetatmoCamera(NetatmoBase, Camera):
await super().async_added_to_hass()
for event_type in (EVENT_TYPE_LIGHT_MODE, EVENT_TYPE_OFF, EVENT_TYPE_ON):
self._listeners.append(
self.data_handler.config_entry.async_on_unload(
async_dispatcher_connect(
self.hass,
f"signal-{DOMAIN}-webhook-{event_type}",