1
0
mirror of synced 2026-03-09 20:13:40 +00:00

Fix bug with Home Assistant discovery and add qos attribute to discovery

This commit is contained in:
Daniel Chesterton
2021-02-22 02:00:44 +00:00
parent e8a7f99152
commit 6ecbbb7205

View File

@@ -166,6 +166,7 @@ if home_assistant:
base_config = {
"availability_topic": topics["status"],
"qos": mqtt_qos,
"device": {
"name": f"Amcrest {device_type}",
"manufacturer": "Amcrest",
@@ -218,10 +219,10 @@ if home_assistant:
)
mqtt_publish(
topics["storage_used"],
topics["home_assistant"]["storage_used"],
base_config
| {
"state_topic": topics["home_assistant"]["storage_used"],
"state_topic": topics["storage_used"],
"unit_of_measurement": "GB",
"icon": "mdi:micro-sd",
"name": f"{device_name} Storage Used",
@@ -231,10 +232,10 @@ if home_assistant:
)
mqtt_publish(
topics["storage_total"],
topics["home_assistant"]["storage_total"],
base_config
| {
"state_topic": topics["home_assistant"]["storage_total"],
"state_topic": topics["storage_total"],
"unit_of_measurement": "GB",
"icon": "mdi:micro-sd",
"name": f"{device_name} Storage Total",