"frontdoor": 0,
"doorbell": 0,
"cabin_driveway": 0,
+ "cabin_front": 0,
}
self.last_trigger_timestamp = {
"driveway": 0,
"frontdoor": 0,
"doorbell": 0,
"cabin_driveway": 0,
+ "cabin_front": 0,
}
def choose_priority(self, camera: str, age: int) -> int:
"""Based on the camera name and last trigger age, compute priority."""
base_priority_by_camera = {
"driveway": 3,
- "frontdoor": 2,
- "doorbell": 1,
+ "frontdoor": 1,
+ "doorbell": 2,
"cabin_driveway": 3,
+ "cabin_front": 3,
}
priority = base_priority_by_camera[camera]
if age < 10:
"""Return a list of triggered pages with priorities."""
triggers = []
num_cameras_with_recent_triggers = 0
- camera_list = ["driveway", "frontdoor", "doorbell", "cabin_driveway"]
+ camera_list = ["driveway", "frontdoor", "doorbell", "cabin_driveway", "cabin_front"]
now = time.time()
try:
filename = f"/timestamps/last_camera_motion_{camera}"
ts = os.stat(filename).st_ctime
age = now - ts
- print(f"{camera} => {age}")
if ts != self.last_trigger_timestamp[camera]:
self.last_trigger_timestamp[camera] = ts
if age < 15: