+ def checkLight(self, somebody_present=None):
+ if somebody_present is None:
+ somebody_present=self.somebodyPresent()
+
+ if self.last_light_value > int(self.uwscfg.tracker_photo_flashlight):
+ return "Light: flashlight"
+ elif self.last_light_value > int(self.uwscfg.tracker_photo_artif_light):
+ if not somebody_present and self.last_light_unixts > self.last_door_operation_unixts:
+ return "Light: forgotten"
+ else:
+ return "Light: on"
+ else:
+ return "Light: off"
+
+
+ def checkAgainIn(self, sec):
+ if self.timer_timeout < time.time():
+ logging.debug("checkAgainIn: starting Timer with timeout %fs" % sec)
+ self.timer=threading.Timer(sec, self.checkPresenceStateChangeAndNotify)
+ self.timer.start()
+ self.timer_timeout = time.time() + sec
+ else:
+ logging.debug("checkAgainIn: not starting timer, already one scheduled in %fs" % (time.time() - self.timer_timeout))
+