mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Catch bad set commands
This commit is contained in:
parent
8edd83c8f9
commit
0826711994
@ -57,9 +57,13 @@ class Dispatcher:
|
|||||||
def _receive(self, topic: str, payload: str) -> None:
|
def _receive(self, topic: str, payload: str) -> None:
|
||||||
"""Handle receiving of payload from communicators."""
|
"""Handle receiving of payload from communicators."""
|
||||||
if topic.endswith("set"):
|
if topic.endswith("set"):
|
||||||
camera_name = topic.split("/")[-3]
|
try:
|
||||||
command = topic.split("/")[-2]
|
camera_name = topic.split("/")[-3]
|
||||||
self._camera_settings_handlers[command](camera_name, payload)
|
command = topic.split("/")[-2]
|
||||||
|
self._camera_settings_handlers[command](camera_name, payload)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(f"Received invalid set command: {topic}")
|
||||||
|
return
|
||||||
elif topic == "restart":
|
elif topic == "restart":
|
||||||
restart_frigate()
|
restart_frigate()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user