In some circumstances device.last_seen can be None (#25690)

This commit is contained in:
Robert Svensson 2019-08-04 16:12:16 +02:00 committed by GitHub
parent f8bd9dbe3e
commit 5a90b49e27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -296,7 +296,9 @@ class UniFiDeviceTracker(ScannerEntity):
)
if (
dt_util.utcnow() - dt_util.utc_from_timestamp(float(self.device.last_seen))
self.device.last_seen
and dt_util.utcnow()
- dt_util.utc_from_timestamp(float(self.device.last_seen))
) < detection_time:
return True
return False