summaryrefslogtreecommitdiff
path: root/waitable_presence.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-02-02 13:47:36 -0800
committerScott <[email protected]>2022-02-02 13:47:36 -0800
commit7ff2af6fe7bffea90dc4a31c93140c189917c659 (patch)
tree34cb138c3a572037b5bc1d1b52ad9d25a2604ccb /waitable_presence.py
parent6ba90a1f30f1c0cf4df12fcd0c62181f29bc3668 (diff)
Let's be explicit with asserts; there was a bug in histogram
caused by assert foo when foo was an int with valid valid 0.
Diffstat (limited to 'waitable_presence.py')
-rw-r--r--waitable_presence.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/waitable_presence.py b/waitable_presence.py
index 8046bdc..1d6c3eb 100644
--- a/waitable_presence.py
+++ b/waitable_presence.py
@@ -98,8 +98,8 @@ class WaitablePresenceDetectorWithMemory(state_tracker.WaitableAutomaticStateTra
if self.someone_is_home is None:
raise Exception("Too Soon!")
if self.someone_is_home:
- assert self.someone_home_since
+ assert self.someone_home_since is not None
return (True, self.someone_home_since)
else:
- assert self.everyone_gone_since
+ assert self.everyone_gone_since is not None
return (False, self.everyone_gone_since)