+ def checkLight(self, somebody_present=None):
+ if somebody_present is None:
+ somebody_present=self.somebodyPresent()
+
+ if self.last_light_value > self.uwscfg.tracker_photo_flashlight:
+ return "Light: flashlight"
+ elif self.last_light_value > self.uwscfg.tracker_photo_daylight:
+ return "Light: daylight"
+ elif self.last_light_value > 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"
+
+