- if (now - self.last_trigger[camera]) < 10:
- if (self.triggers_in_the_past_seven_min[camera] <= 4 or
- cameras_with_recent_triggers > 1):
- ts = utils.timestamp()
- p = self.choose_priority(camera, age)
- print(("%s: ****** %s[%d] CAMERA TRIGGER ******" % (
- ts, camera, p)))
- triggers.append( ( "hidden/%s.html" % camera,
- self.choose_priority(camera, age)) )
+ if (now - self.last_trigger_timestamp[camera]) < 10:
+ if (
+ self.triggers_in_the_past_seven_min[camera] <= 4
+ or num_cameras_with_recent_triggers > 1
+ ):
+ priority = self.choose_priority(camera, int(age))
+ print(
+ f"{utils.timestamp()}: *** {camera}[{priority}] CAMERA TRIGGER ***"
+ )
+ triggers.append(
+ (
+ f"hidden/{camera}.html",
+ priority,
+ )
+ )