Duh, no ** deref in json...
This commit is contained in:
32
gauge.py
32
gauge.py
@@ -754,14 +754,6 @@ def publish_discovery(client):
|
|||||||
]:
|
]:
|
||||||
client.publish(old_t, b"", retain=True)
|
client.publish(old_t, b"", retain=True)
|
||||||
|
|
||||||
_indicator_light = {
|
|
||||||
"schema": "json",
|
|
||||||
"supported_color_modes": ["onoff"],
|
|
||||||
"effect": True,
|
|
||||||
"effect_list": _EFFECT_LIST,
|
|
||||||
"ret": True,
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, g in enumerate(gauges):
|
for i, g in enumerate(gauges):
|
||||||
gt = gauge_topics[i]
|
gt = gauge_topics[i]
|
||||||
|
|
||||||
@@ -797,9 +789,13 @@ def publish_discovery(client):
|
|||||||
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_red",
|
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_red",
|
||||||
"cmd_t": gt["led_red"],
|
"cmd_t": gt["led_red"],
|
||||||
"stat_t": gt["led_red_state"],
|
"stat_t": gt["led_red_state"],
|
||||||
|
"schema": "json",
|
||||||
|
"supported_color_modes": ["onoff"],
|
||||||
|
"effect": True,
|
||||||
|
"effect_list": _EFFECT_LIST,
|
||||||
"icon": "mdi:led-on",
|
"icon": "mdi:led-on",
|
||||||
"dev": _dev_ref,
|
"dev": _dev_ref,
|
||||||
**_indicator_light,
|
"ret": True,
|
||||||
}),
|
}),
|
||||||
retain=True,
|
retain=True,
|
||||||
)
|
)
|
||||||
@@ -812,9 +808,13 @@ def publish_discovery(client):
|
|||||||
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_green",
|
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_green",
|
||||||
"cmd_t": gt["led_green"],
|
"cmd_t": gt["led_green"],
|
||||||
"stat_t": gt["led_green_state"],
|
"stat_t": gt["led_green_state"],
|
||||||
|
"schema": "json",
|
||||||
|
"supported_color_modes": ["onoff"],
|
||||||
|
"effect": True,
|
||||||
|
"effect_list": _EFFECT_LIST,
|
||||||
"icon": "mdi:led-on",
|
"icon": "mdi:led-on",
|
||||||
"dev": _dev_ref,
|
"dev": _dev_ref,
|
||||||
**_indicator_light,
|
"ret": True,
|
||||||
}),
|
}),
|
||||||
retain=True,
|
retain=True,
|
||||||
)
|
)
|
||||||
@@ -852,9 +852,13 @@ def publish_discovery(client):
|
|||||||
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_status_red",
|
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_status_red",
|
||||||
"cmd_t": gt["status_red"],
|
"cmd_t": gt["status_red"],
|
||||||
"stat_t": gt["status_red_state"],
|
"stat_t": gt["status_red_state"],
|
||||||
|
"schema": "json",
|
||||||
|
"supported_color_modes": ["onoff"],
|
||||||
|
"effect": True,
|
||||||
|
"effect_list": _EFFECT_LIST,
|
||||||
"icon": "mdi:led-on",
|
"icon": "mdi:led-on",
|
||||||
"dev": _dev_ref,
|
"dev": _dev_ref,
|
||||||
**_indicator_light,
|
"ret": True,
|
||||||
}),
|
}),
|
||||||
retain=True,
|
retain=True,
|
||||||
)
|
)
|
||||||
@@ -867,9 +871,13 @@ def publish_discovery(client):
|
|||||||
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_status_green",
|
"uniq_id": f"{MQTT_CLIENT_ID}_g{i}_status_green",
|
||||||
"cmd_t": gt["status_green"],
|
"cmd_t": gt["status_green"],
|
||||||
"stat_t": gt["status_green_state"],
|
"stat_t": gt["status_green_state"],
|
||||||
|
"schema": "json",
|
||||||
|
"supported_color_modes": ["onoff"],
|
||||||
|
"effect": True,
|
||||||
|
"effect_list": _EFFECT_LIST,
|
||||||
"icon": "mdi:led-on",
|
"icon": "mdi:led-on",
|
||||||
"dev": _dev_ref,
|
"dev": _dev_ref,
|
||||||
**_indicator_light,
|
"ret": True,
|
||||||
}),
|
}),
|
||||||
retain=True,
|
retain=True,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user