fix last change detection
This commit is contained in:
parent
191bcae1ff
commit
6b952d8e2f
1 changed files with 1 additions and 1 deletions
|
@ -182,7 +182,7 @@ def run_forever(address: str, period: int, ssid: str, output: str, webhook_url:
|
|||
last_change = None
|
||||
for ts, leases in groupby(_fetch_leases(db, now - timedelta(days=7)), key=attrgetter('ts')):
|
||||
humans_present = [lease for lease in leases if _is_human(lease)]
|
||||
if (len(humans_present) > 0) != status.level > 0:
|
||||
if (len(humans_present) > 0) != (status.level > 0):
|
||||
last_change = {'ts': ts, 'leases': humans_present}
|
||||
break
|
||||
|
||||
|
|
Loading…
Reference in a new issue