From 19e6374e036143623a38a7739ca69524d77b0021 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 24 Apr 2023 12:40:44 +0200 Subject: [PATCH] Rename 'Sleep mode' switch (#714) * Rename 'Sleep mode' switch Renamed from `Sleep Modus` to `Sleep mode`. Breaking change: This will rename the entity_id of that switch and this can affect existing automations created by users and also will require changes in the blueprint if #698 is merged. Note: Variable names in HMI/TFT not renamed. * Align with other PR --- nspanel_blueprint.yaml | 2 +- nspanel_esphome.yaml | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index a66a1df..2c4cf6d 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -3347,7 +3347,7 @@ trigger_variables: nspaneltemp: 'sensor.{{ nspanel_name }}_temperature' settings_entity: 'sensor.{{ nspanel_name }}_settings_entity' reboot_button: 'button.{{ nspanel_name }}_restart' - switch_sleep_mode: 'switch.{{ nspanel_name }}_sleep_modus' + switch_sleep_mode: 'switch.{{ nspanel_name }}_sleep_mode' ##### notification Trigger ##### notification_unread: 'switch.{{ nspanel_name }}_notification_unread' diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index 4b91d8e..074e347 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -410,7 +410,7 @@ globals: initial_value: '0.0' ##### Save Display DIM Brightness for NSPanel reboot - - id: sleep_modus_global + - id: sleep_mode_global type: int restore_value: true initial_value: '0' @@ -502,14 +502,14 @@ binary_sensor: on_click: - button.press: restart_nspanel - ##### Sleep Modus NSPanel Button ##### - - name: ${device_name} Sleep Modus + ##### Sleep mode NSPanel Button ##### + - name: ${device_name} Sleep mode platform: nextion page_id: 7 component_id: 14 internal: true on_click: - - switch.toggle: sleep_modus + - switch.toggle: sleep_mode ##### START - SENSOR CONFIGURATION ##### sensor: @@ -730,11 +730,11 @@ switch: restore_mode: ALWAYS_ON internal: true - ##### Switch Display Sleep Modus ##### - - name: ${device_name} Sleep Modus + ##### Switch Display Sleep mode ##### + - name: ${device_name} Sleep mode platform: template device_class: switch - id: sleep_modus + id: sleep_mode entity_category: config restore_state: true assumed_state: false @@ -742,13 +742,13 @@ switch: on_turn_off: - lambda: id(disp1).send_command_printf("home.sleepmodus.val=0"); - globals.set: - id: sleep_modus_global + id: sleep_mode_global value: '0' - lambda: id(disp1).set_component_value("settings.bt1",0); on_turn_on: - lambda: id(disp1).send_command_printf("home.sleepmodus.val=1"); - globals.set: - id: sleep_modus_global + id: sleep_mode_global value: '1' - lambda: id(disp1).set_component_value("settings.bt1",1); @@ -860,8 +860,8 @@ display: - lambda: id(disp1).set_component_text_printf("settings.a04", "%i", id(display_dim_brightness_global)); - lambda: id(disp1).send_command_printf("settings.brightslider.val=%i", id(display_brightness_global)); - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global)); - - lambda: id(disp1).send_command_printf("home.sleepmodus.val=%i", id(sleep_modus_global)); - - lambda: id(disp1).set_component_value("settings.a02", id(sleep_modus_global) == 1); + - lambda: id(disp1).send_command_printf("home.sleepmodus.val=%i", id(sleep_mode_global)); + - lambda: id(disp1).set_component_value("settings.a02", id(sleep_mode_global) == 1); - delay: 1s - switch.template.publish: id: nextion_init