fix HA entity name prefix warnings (closes #1011)
This commit is contained in:
@@ -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.
|
# HA integration: this is the config topic payload for HA's MQTT discovery.
|
||||||
definition-payload = {
|
definition-payload = {
|
||||||
"unique_id":"%{TOPIC}_%FIELD",
|
"unique_id":"%{TOPIC}_%FIELD",
|
||||||
"name":"%prefixn %circuit %name %fieldname",
|
"name":"%name %fieldname",
|
||||||
"device":%circuit_part,
|
"device":%circuit_part,
|
||||||
"value_template":"{{value_json[\"%field\"].value}}",
|
"value_template":"{{value_json[\"%field\"].value}}",
|
||||||
"state_topic":"%topic"%field_payload
|
"state_topic":"%topic"%field_payload
|
||||||
@@ -340,7 +340,7 @@ global_prefix = {
|
|||||||
"unique_id":"%TOPIC",
|
"unique_id":"%TOPIC",
|
||||||
"device":%global_device,
|
"device":%global_device,
|
||||||
"state_topic":"%topic",
|
"state_topic":"%topic",
|
||||||
"name":"%prefixn %name"
|
"name":"global %name"
|
||||||
|
|
||||||
# HA integration: boolean suffix for global parts
|
# HA integration: boolean suffix for global parts
|
||||||
global_boolean_suffix = ,
|
global_boolean_suffix = ,
|
||||||
@@ -387,7 +387,7 @@ def_global_updatecheck_device-payload = {
|
|||||||
"suggested_area":"%area"
|
"suggested_area":"%area"
|
||||||
},
|
},
|
||||||
"state_topic":"%topic",
|
"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 }}"
|
"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 }}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user