In some circumstances device.last_seen can be None (#25690)
This commit is contained in:
parent
f8bd9dbe3e
commit
5a90b49e27
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue