From 95ff13d83125075fb3b99c5546a0c4b8fb520a0d Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 10 Apr 2023 23:58:12 +0200 Subject: [PATCH] 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. --- nspanel_blueprint.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index 7a1904e..d7f8308 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -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"