diff --git a/homeassistant/components/unifi/device_tracker.py b/homeassistant/components/unifi/device_tracker.py index df93916e45b54b60e548d6a307256c3118cafd15..d09259f0299355451933020b8663e041645ec7b3 100644 --- a/homeassistant/components/unifi/device_tracker.py +++ b/homeassistant/components/unifi/device_tracker.py @@ -148,13 +148,6 @@ class UniFiClientTracker(UniFiClient, ScannerEntity): self.cancel_scheduled_update = None 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 ( not self.is_wired and self.wireless_connection ): @@ -174,6 +167,15 @@ class UniFiClientTracker(UniFiClient, ScannerEntity): 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: return not self.is_disconnected