Convert napanel_name to a valid format (#647)

This supports users mistyping the NSPanel name in the blueprint settings. One of the most common mistakes is using `-` in the name, instead of `_` and this change will try to replace that when users type the name with this invalid char.
This commit is contained in:
Edward Firmo
2023-04-10 23:58:12 +02:00
committed by GitHub
parent 59727e294d
commit 95ff13d831

View File

@@ -2326,7 +2326,8 @@ trace:
#############################################################
trigger_variables:
nspanel_name: !input "nspanel_name"
nspanel_name_temp: !input "nspanel_name"
nspanel_name: "{{ nspanel_name_temp | replace('-','_') | replace(' ','_') | replace('___','_') | replace('__','_') }}"
last_click: "sensor.{{ nspanel_name }}_last_click"
last_click_lightsettings: "sensor.{{ nspanel_name }}_last_click_lightsettings"
last_click_coversettings: "sensor.{{ nspanel_name }}_last_click_coversettings"