Add cabin front.
authorScott Gasch <[email protected]>
Sat, 30 May 2026 18:24:35 +0000 (11:24 -0700)
committerScott Gasch <[email protected]>
Sat, 30 May 2026 18:24:35 +0000 (11:24 -0700)
camera_trigger.py

index 3eebe2a092947f32ab4204dd4b5f653ca13c71d7..08274d001063133de216746160f9072f502085c7 100644 (file)
@@ -18,21 +18,24 @@ class any_camera_trigger(trigger.trigger):
             "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:
@@ -47,7 +50,7 @@ class any_camera_trigger(trigger.trigger):
         """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:
@@ -58,7 +61,6 @@ class any_camera_trigger(trigger.trigger):
                 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: