From 6791df7971ac4c79834a73f668e0830893bc4c89 Mon Sep 17 00:00:00 2001 From: Nick Rogers <1903140+rogersnm@users.noreply.github.com> Date: Thu, 24 Sep 2026 22:44:07 +0100 Subject: [PATCH] Fix ZMQ detector ignoring the endpoint in its device string (#24464) --- frigate/detectors/plugins/zmq_ipc.py | 3 ++- frigate/test/test_detector_device.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frigate/detectors/plugins/zmq_ipc.py b/frigate/detectors/plugins/zmq_ipc.py index cc9a538c81..b65cb801e8 100644 --- a/frigate/detectors/plugins/zmq_ipc.py +++ b/frigate/detectors/plugins/zmq_ipc.py @@ -1,7 +1,7 @@ import json import logging import os -from typing import Any, Literal +from typing import Any, ClassVar, Literal import numpy as np import zmq @@ -21,6 +21,7 @@ class ZmqDetectorConfig(BaseDetectorConfig): model_config = ConfigDict( title="ZMQ IPC", ) + device_spec_field: ClassVar[str] = "endpoint" type: Literal[DETECTOR_KEY] endpoint: str = Field( diff --git a/frigate/test/test_detector_device.py b/frigate/test/test_detector_device.py index 4b7ccc625f..d63aa831ca 100644 --- a/frigate/test/test_detector_device.py +++ b/frigate/test/test_detector_device.py @@ -59,6 +59,10 @@ class TestBuildDetectorConfig(unittest.TestCase): def test_detectors_that_name_the_field_something_else(self): self.assertEqual(self._build("cpu:4").num_threads, 4) self.assertEqual(self._build("rknn:2").num_cores, 2) + self.assertEqual( + self._build("zmq:tcp://host.docker.internal:5555").endpoint, + "tcp://host.docker.internal:5555", + ) def test_device_is_coerced_to_the_detector_field_type(self): self.assertEqual(self._build("tensorrt:1").device, 1) @@ -66,6 +70,7 @@ class TestBuildDetectorConfig(unittest.TestCase): def test_omitted_device_falls_back_to_the_detector_default(self): self.assertEqual(self._build("cpu").num_threads, 3) self.assertEqual(self._build("rknn").num_cores, 0) + self.assertEqual(self._build("zmq").endpoint, "ipc:///tmp/cache/zmq_detector") self.assertEqual(self._build("openvino").device, "AUTO") self.assertIsNone(self._build("edgetpu").device)