mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-10 07:25:27 +03:00
remove available profiles from mqtt
This commit is contained in:
parent
78bc11d7e0
commit
1ea9692b49
@ -283,17 +283,6 @@ Topic to activate or deactivate a [profile](/configuration/profiles). Publish a
|
|||||||
|
|
||||||
Topic with the currently active profile name. Published value is the profile name or `none` if no profile is active. This topic is retained.
|
Topic with the currently active profile name. Published value is the profile name or `none` if no profile is active. This topic is retained.
|
||||||
|
|
||||||
### `frigate/profiles/available`
|
|
||||||
|
|
||||||
Topic with a JSON array of all available profile definitions. Published on startup as a retained message.
|
|
||||||
|
|
||||||
```json
|
|
||||||
[
|
|
||||||
{ "name": "away", "friendly_name": "Away" },
|
|
||||||
{ "name": "home", "friendly_name": "Home" }
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
### `frigate/notifications/set`
|
### `frigate/notifications/set`
|
||||||
|
|
||||||
Topic to turn notifications on and off. Expected values are `ON` and `OFF`.
|
Topic to turn notifications on and off. Expected values are `ON` and `OFF`.
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import json
|
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
from typing import Any, Callable
|
from typing import Any, Callable
|
||||||
@ -169,16 +168,6 @@ class MqttClient(Communicator):
|
|||||||
self.config.active_profile or "none",
|
self.config.active_profile or "none",
|
||||||
retain=True,
|
retain=True,
|
||||||
)
|
)
|
||||||
available_profiles = [
|
|
||||||
{"name": name, "friendly_name": defn.friendly_name}
|
|
||||||
for name, defn in sorted(self.config.profiles.items())
|
|
||||||
]
|
|
||||||
self.publish(
|
|
||||||
"profiles/available",
|
|
||||||
json.dumps(available_profiles),
|
|
||||||
retain=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
self.publish("available", "online", retain=True)
|
self.publish("available", "online", retain=True)
|
||||||
|
|
||||||
def on_mqtt_command(
|
def on_mqtt_command(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user