change birdseye mode topic to set

This commit is contained in:
Shaun Berryman 2023-10-24 07:16:36 -07:00
parent aa4df22785
commit 1b74ec81c1
3 changed files with 3 additions and 15 deletions

View File

@ -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`.
### `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.

View File

@ -64,6 +64,7 @@ class Dispatcher:
"recordings": self._on_recordings_command,
"snapshots": self._on_snapshots_command,
"birdseye": self._on_birdseye_command,
"birdseye_mode": self._on_birdseye_mode_command,
}
for comm in self.comms:
@ -97,14 +98,6 @@ class Dispatcher:
self.camera_metrics[camera]["region_grid_queue"].put(
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:
self.publish(topic, payload, retain=False)

View File

@ -173,6 +173,7 @@ class MqttClient(Communicator): # type: ignore[misc]
"motion_threshold",
"motion_contour_area",
"birdseye",
"birdseye_mode",
]
for name in self.config.cameras.keys():
@ -196,12 +197,6 @@ class MqttClient(Communicator): # type: ignore[misc]
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(
f"{self.mqtt_config.topic_prefix}/restart", self.on_mqtt_command
)