UniFi - Improve handling of client tracker is connected to better respect configured delay (#34510)

This commit is contained in:
Robert Svensson 2020-04-21 21:12:44 +02:00 committed by GitHub
parent b73c774b07
commit e004cd029a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -148,13 +148,6 @@ class UniFiClientTracker(UniFiClient, ScannerEntity):
self.cancel_scheduled_update = None self.cancel_scheduled_update = None
self.async_write_ha_state() self.async_write_ha_state()
if (
not self.is_wired
and self.controller.option_ssid_filter
and self.client.essid not in self.controller.option_ssid_filter
):
return False
if (self.is_wired and self.wired_connection) or ( if (self.is_wired and self.wired_connection) or (
not self.is_wired and self.wireless_connection not self.is_wired and self.wireless_connection
): ):
@ -174,6 +167,15 @@ class UniFiClientTracker(UniFiClient, ScannerEntity):
dt_util.utcnow() + self.controller.option_detection_time, dt_util.utcnow() + self.controller.option_detection_time,
) )
if (
not self.is_wired
and self.client.essid
and self.controller.option_ssid_filter
and self.client.essid not in self.controller.option_ssid_filter
and not self.cancel_scheduled_update
):
return False
if self.is_disconnected is not None: if self.is_disconnected is not None:
return not self.is_disconnected return not self.is_disconnected