mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-28 01:14:40 +03:00
Compare commits
1
Commits
dev
..
tweak-icons
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17b94131cc |
@@ -178,7 +178,6 @@ class AudioProcessor(FrigateProcess):
|
|||||||
[
|
[
|
||||||
CameraConfigUpdateEnum.add,
|
CameraConfigUpdateEnum.add,
|
||||||
CameraConfigUpdateEnum.audio,
|
CameraConfigUpdateEnum.audio,
|
||||||
CameraConfigUpdateEnum.enabled,
|
|
||||||
CameraConfigUpdateEnum.ffmpeg,
|
CameraConfigUpdateEnum.ffmpeg,
|
||||||
CameraConfigUpdateEnum.remove,
|
CameraConfigUpdateEnum.remove,
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
"""Tests for audio maintainer spawning on runtime camera updates."""
|
"""Tests for audio maintainer spawning on runtime camera adds."""
|
||||||
|
|
||||||
import threading
|
import threading
|
||||||
import unittest
|
import unittest
|
||||||
@@ -42,42 +42,6 @@ class TestAudioSpawnIfNeeded(unittest.TestCase):
|
|||||||
processor.logger = MagicMock()
|
processor.logger = MagicMock()
|
||||||
return processor
|
return processor
|
||||||
|
|
||||||
def test_initially_disabled_camera_spawns_after_enabled_update(self):
|
|
||||||
"""Consume an enabled update through the manager's real subscriber."""
|
|
||||||
config = _build_config()
|
|
||||||
config.cameras["front_door"].enabled = False
|
|
||||||
stop = MagicMock()
|
|
||||||
stop.wait.side_effect = [False, True]
|
|
||||||
processor = AudioProcessor(
|
|
||||||
config, {"front_door": MagicMock()}, MagicMock(), stop
|
|
||||||
)
|
|
||||||
processor.logger = MagicMock()
|
|
||||||
updates = iter([("config/cameras/front_door/enabled", True), (None, None)])
|
|
||||||
self.addCleanup(
|
|
||||||
setattr, threading.current_thread(), "name", threading.current_thread().name
|
|
||||||
)
|
|
||||||
|
|
||||||
with (
|
|
||||||
patch.object(processor, "pre_run_setup"),
|
|
||||||
patch("frigate.config.camera.updater.ConfigSubscriber") as transport,
|
|
||||||
patch("frigate.events.audio.AudioEventMaintainer") as maintainer,
|
|
||||||
):
|
|
||||||
|
|
||||||
def receive_update():
|
|
||||||
self.assertEqual(processor.audio_threads, {})
|
|
||||||
maintainer.assert_not_called()
|
|
||||||
return next(updates)
|
|
||||||
|
|
||||||
transport.return_value.check_for_update.side_effect = receive_update
|
|
||||||
maintainer.return_value.is_alive.return_value = False
|
|
||||||
processor.run()
|
|
||||||
|
|
||||||
self.assertEqual(
|
|
||||||
processor.audio_threads, {"front_door": maintainer.return_value}
|
|
||||||
)
|
|
||||||
maintainer.assert_called_once()
|
|
||||||
maintainer.return_value.start.assert_called_once()
|
|
||||||
|
|
||||||
def test_skips_camera_whose_metrics_have_not_been_created_yet(self):
|
def test_skips_camera_whose_metrics_have_not_been_created_yet(self):
|
||||||
"""The camera maintainer creates metrics on its own poll of the add
|
"""The camera maintainer creates metrics on its own poll of the add
|
||||||
update, so the audio processor can see the camera first."""
|
update, so the audio processor can see the camera first."""
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -7,6 +7,11 @@
|
|||||||
<metadata>
|
<metadata>
|
||||||
Created by potrace 1.11, written by Peter Selinger 2001-2013
|
Created by potrace 1.11, written by Peter Selinger 2001-2013
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<style>
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
g { fill: #ffffff; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<g transform="translate(0.000000,888.000000) scale(0.100000,-0.100000)"
|
<g transform="translate(0.000000,888.000000) scale(0.100000,-0.100000)"
|
||||||
fill="#000000" stroke="none">
|
fill="#000000" stroke="none">
|
||||||
<path d="M8228 8865 c-2 -2 -25 -6 -53 -9 -38 -5 -278 -56 -425 -91 -33 -7
|
<path d="M8228 8865 c-2 -2 -25 -6 -53 -9 -38 -5 -278 -56 -425 -91 -33 -7
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.0 KiB |
Reference in New Issue
Block a user