Merge of nested IF-IF cases - K-N (#48370)

This commit is contained in:
Franck Nijhof 2021-03-27 10:03:15 +01:00 committed by GitHub
parent 9737480742
commit 86212db71d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 86 additions and 65 deletions

View file

@ -276,9 +276,8 @@ class MikrotikData:
def update(self):
"""Update device_tracker from Mikrotik API."""
if not self.available or not self.api:
if not self.connect_to_hub():
return
if (not self.available or not self.api) and not self.connect_to_hub():
return
_LOGGER.debug("updating network devices for host: %s", self._host)
self.update_devices()