Refresh snapshots after light actions

This commit is contained in:
2026-08-03 01:28:56 +02:00
parent 127d07dc6b
commit 4ea737024b
14 changed files with 177 additions and 6 deletions
+13 -1
View File
@@ -4,10 +4,12 @@ from frigate_camera_control_bridge.app import CameraControlBridge
class DummyAction:
def __init__(self, action_id, camera=None, kind="hikvision_colorvu"):
def __init__(self, action_id, camera=None, kind="hikvision_colorvu", name_key=None):
self.id = action_id
self.kind = kind
self.cfg = {}
if name_key:
self.cfg["name_key"] = name_key
if camera:
self.cfg["snapshot"] = {
"frigate_url": "http://frigate.example.test:5000",
@@ -52,6 +54,16 @@ class RefreshSummaryTest(unittest.TestCase):
self.assertEqual(message, "No camera changes found.")
def test_light_actions_refresh_snapshot_after_on_off(self):
white = DummyAction("white", "one", name_key="action.manual_white")
red_blue = DummyAction("red_blue", "one", name_key="action.red_blue")
siren = DummyAction("siren", "one", name_key="action.siren")
self.assertTrue(CameraControlBridge.should_refresh_snapshot_after_command(white, "on"))
self.assertTrue(CameraControlBridge.should_refresh_snapshot_after_command(red_blue, "off"))
self.assertFalse(CameraControlBridge.should_refresh_snapshot_after_command(siren, "on"))
self.assertFalse(CameraControlBridge.should_refresh_snapshot_after_command(white, "press"))
if __name__ == "__main__":
unittest.main()