fix HA entity name prefix warnings (closes #1011)

This commit is contained in:
John
2023-10-07 17:42:57 +02:00
parent 9e236bb206
commit 7cc7e64e65
+3 -3
View File
@@ -311,7 +311,7 @@ definition-topic ?= %haprefix/%type_topic/%{TOPIC}_%FIELD/config
# HA integration: this is the config topic payload for HA's MQTT discovery.
definition-payload = {
"unique_id":"%{TOPIC}_%FIELD",
"name":"%prefixn %circuit %name %fieldname",
"name":"%name %fieldname",
"device":%circuit_part,
"value_template":"{{value_json[\"%field\"].value}}",
"state_topic":"%topic"%field_payload
@@ -340,7 +340,7 @@ global_prefix = {
"unique_id":"%TOPIC",
"device":%global_device,
"state_topic":"%topic",
"name":"%prefixn %name"
"name":"global %name"
# HA integration: boolean suffix for global parts
global_boolean_suffix = ,
@@ -387,7 +387,7 @@ def_global_updatecheck_device-payload = {
"suggested_area":"%area"
},
"state_topic":"%topic",
"name":"%prefixn %name",
"name":"%name",
"value_template":"{%% set my_new = value_json|truncate(255)|regex_replace(find='^[^,]*|, device firmware |,.*| available',replace='') %%}{%% set my_cur = 'old' %%}{%% if my_new == '' %%}{%% set my_new = 'current' %%}{%% set my_cur = 'current' %%}{%% endif %%}{{ {'installed_version':my_cur,'latest_version':my_new,'entity_picture':'https://adapter.ebusd.eu/favicon.ico','release_url':'https://adapter.ebusd.eu/firmware/ChangeLog'} | tojson }}"
}