diff --git a/frigate/test/test_camera_watchdog.py b/frigate/test/test_camera_watchdog.py index 8af8658c7c..286b3b459a 100644 --- a/frigate/test/test_camera_watchdog.py +++ b/frigate/test/test_camera_watchdog.py @@ -59,7 +59,6 @@ def build_watchdog( MagicMock(), ) - watchdog.requestor = MagicMock() return watchdog @@ -108,8 +107,8 @@ class TestCameraWatchdogStreamHealth(unittest.TestCase): def test_status_goes_to_the_matching_role_topic(self): watchdog = self._build_watchdog() - watchdog._send_record_status(STREAM_TYPE_MAIN, "online", 100.0) - watchdog._send_record_status(STREAM_TYPE_SUB, "offline", 100.0) + watchdog.record_status[STREAM_TYPE_MAIN].send("online", 100.0) + watchdog.record_status[STREAM_TYPE_SUB].send("offline", 100.0) watchdog.requestor.send_data.assert_any_call( "front_door/status/record", "online" @@ -121,9 +120,9 @@ class TestCameraWatchdogStreamHealth(unittest.TestCase): def test_status_is_cached_per_stream(self): watchdog = self._build_watchdog() - watchdog._send_record_status(STREAM_TYPE_MAIN, "online", 100.0) - watchdog._send_record_status(STREAM_TYPE_SUB, "online", 100.0) - watchdog._send_record_status(STREAM_TYPE_MAIN, "online", 100.0) + watchdog.record_status[STREAM_TYPE_MAIN].send("online", 100.0) + watchdog.record_status[STREAM_TYPE_SUB].send("online", 100.0) + watchdog.record_status[STREAM_TYPE_MAIN].send("online", 100.0) assert watchdog.requestor.send_data.call_count == 2 diff --git a/frigate/video/ffmpeg.py b/frigate/video/ffmpeg.py index 2313564c5d..c4364f8d71 100644 --- a/frigate/video/ffmpeg.py +++ b/frigate/video/ffmpeg.py @@ -120,6 +120,7 @@ class RoleStatus: last_update_time: float = 0.0 def send(self, status: str, now: float) -> None: + """Publish a changed status or resend it after the configured interval.""" if ( status != self.last_status or (now - self.last_update_time) >= self.resend_interval