device tracker returns away when tracking is disabled #24

This commit is contained in:
tomaae 2020-04-10 12:30:07 +02:00
parent 6a8103ee47
commit 92da2eb9a7

View file

@ -275,6 +275,9 @@ class MikrotikControllerHostDeviceTracker(ScannerEntity):
@property @property
def is_connected(self): def is_connected(self):
"""Return true if the host is connected to the network.""" """Return true if the host is connected to the network."""
if not self.option_track_network_hosts:
return False
if self._data["source"] in ["capsman", "wireless"]: if self._data["source"] in ["capsman", "wireless"]:
return self._data["available"] return self._data["available"]