mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
change birdseye mode topic to set
This commit is contained in:
parent
aa4df22785
commit
1b74ec81c1
@ -230,7 +230,7 @@ must be enabled in the configuration.
|
|||||||
|
|
||||||
Topic with current state of Birdseye for a camera. Published values are `ON` and `OFF`.
|
Topic with current state of Birdseye for a camera. Published values are `ON` and `OFF`.
|
||||||
|
|
||||||
### `frigate/<camera_name>/birdseye_mode`
|
### `frigate/<camera_name>/birdseye_mode/set`
|
||||||
|
|
||||||
Topic to set Birdseye mode for a camera. Birdseye offers different modes to customize under which circumstances the camera is shown.
|
Topic to set Birdseye mode for a camera. Birdseye offers different modes to customize under which circumstances the camera is shown.
|
||||||
|
|
||||||
|
|||||||
@ -64,6 +64,7 @@ class Dispatcher:
|
|||||||
"recordings": self._on_recordings_command,
|
"recordings": self._on_recordings_command,
|
||||||
"snapshots": self._on_snapshots_command,
|
"snapshots": self._on_snapshots_command,
|
||||||
"birdseye": self._on_birdseye_command,
|
"birdseye": self._on_birdseye_command,
|
||||||
|
"birdseye_mode": self._on_birdseye_mode_command,
|
||||||
}
|
}
|
||||||
|
|
||||||
for comm in self.comms:
|
for comm in self.comms:
|
||||||
@ -97,14 +98,6 @@ class Dispatcher:
|
|||||||
self.camera_metrics[camera]["region_grid_queue"].put(
|
self.camera_metrics[camera]["region_grid_queue"].put(
|
||||||
get_camera_regions_grid(camera, self.config.cameras[camera].detect)
|
get_camera_regions_grid(camera, self.config.cameras[camera].detect)
|
||||||
)
|
)
|
||||||
elif topic.endswith("birdseye_mode"):
|
|
||||||
try:
|
|
||||||
# example /cam_name/birdseye payload=CONTINUOUS|MOTION|OBJECTS
|
|
||||||
camera_name = topic.split("/")[-2]
|
|
||||||
self._on_birdseye_mode_command(camera_name, payload)
|
|
||||||
except IndexError:
|
|
||||||
logger.error(f"Received invalid birdseye_mode command: {topic}")
|
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
self.publish(topic, payload, retain=False)
|
self.publish(topic, payload, retain=False)
|
||||||
|
|
||||||
|
|||||||
@ -173,6 +173,7 @@ class MqttClient(Communicator): # type: ignore[misc]
|
|||||||
"motion_threshold",
|
"motion_threshold",
|
||||||
"motion_contour_area",
|
"motion_contour_area",
|
||||||
"birdseye",
|
"birdseye",
|
||||||
|
"birdseye_mode",
|
||||||
]
|
]
|
||||||
|
|
||||||
for name in self.config.cameras.keys():
|
for name in self.config.cameras.keys():
|
||||||
@ -196,12 +197,6 @@ class MqttClient(Communicator): # type: ignore[misc]
|
|||||||
self.on_mqtt_command,
|
self.on_mqtt_command,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.config.cameras[name].birdseye.enabled:
|
|
||||||
self.client.message_callback_add(
|
|
||||||
f"{self.mqtt_config.topic_prefix}/{name}/birdseye_mode",
|
|
||||||
self.on_mqtt_command,
|
|
||||||
)
|
|
||||||
|
|
||||||
self.client.message_callback_add(
|
self.client.message_callback_add(
|
||||||
f"{self.mqtt_config.topic_prefix}/restart", self.on_mqtt_command
|
f"{self.mqtt_config.topic_prefix}/restart", self.on_mqtt_command
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user