+ def getPossibleWarning(self):
+ with self.lock:
+ somebody_present=self.last_somebody_present_result
+ if self.door_open and not somebody_present and time.time() - self.last_door_operation_unixts >= float(self.uwscfg.tracker_sec_wait_for_movement_before_warning):
+ return "Door opened recently but nobody present"
+ elif self.door_open and not somebody_present:
+ self.checkAgainIn(float(self.uwscfg.tracker_sec_wait_for_movement_before_warning))
+ return None
+# elif not somebody_present and self.last_light_unixts > self.last_door_operation_unixts and self.last_light_value > int(self.uwscfg.tracker_photo_artif_light):
+#return "Nobody here but light is still on"
+ else:
+ return None
+
+ def updateWhoMightBeHere(self, who):
+ with self.presence_notify_lock:
+ self.who_might_be_here = who
+
+ def forgetWhoMightBeHere(self, somebody_present):
+ with self.presence_notify_lock:
+ if not somebody_present:
+ self.who_might_be_here = None
+