Don't parse previous messages when UniFi connection state change to available (#45544)

* Don't parse previous messages when connection state change to available

* Disable pylint for arguments-differ W0221 message
This commit is contained in:
Robert Svensson 2021-01-26 16:41:28 +01:00 committed by GitHub
parent baab9b9a81
commit 26764a805b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 56 additions and 13 deletions

View file

@ -39,7 +39,7 @@ class UniFiBase(Entity):
self.key,
)
for signal, method in (
(self.controller.signal_reachable, self.async_update_callback),
(self.controller.signal_reachable, self.async_signal_reachable_callback),
(self.controller.signal_options_update, self.options_updated),
(self.controller.signal_remove, self.remove_item),
):
@ -57,6 +57,11 @@ class UniFiBase(Entity):
self._item.remove_callback(self.async_update_callback)
self.controller.entities[self.DOMAIN][self.TYPE].remove(self.key)
@callback
def async_signal_reachable_callback(self) -> None:
"""Call when controller connection state change."""
self.async_update_callback()
@callback
def async_update_callback(self) -> None:
"""Update the entity's state."""