From 5f1f6c14f63c43a9b09031ca1a9de2a32760cea6 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:58:11 +0100 Subject: [PATCH] Remove restart with 15sec press The benefit was small compared to the restriction caused. Still available as a customization or with the reset button. Helps with #1711 --- ReleaseNotes.md | 3 ++- docs/customization.md | 30 ++++++++++++++++++++++++++++++ esphome/nspanel_esphome_core.yaml | 15 --------------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 946a6d0..6339ff1 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -58,7 +58,8 @@ We did our best to support your legacy settings and avoid breaking your system, We understand this change can require substantial work on the exisiting automations with direct calls to the panel's services, however this will significantly improve the future customizations by providing compreensive documentation, standardizing and optimizing services calls. -3. **`captive_portal` and `web_server` are back to basic package**. If you want to remove those to free-up memory, please use [customizations](docs/customization.md#remove-non-essential-components). +3. **`captive_portal` and `web_server` are back to basic package**. If you want to remove those to free-up memory, please look at "[Customizations - Remove non-essential components](docs/customization.md#remove-non-essential-components)". +4. **15s hardware button press no longer restarts the device**. The benefits of this were too small compared to leaving the button available for other uses. If you still want the 15s restart behaviour, you can look at "[Customizations - Restart with 15s button press](docs/customization.md#restart-with-15s-button-press) and, in addition to that, the [reset pin in the bottom of your panel](docs/pics/eu_reset_button.png) can be used. ## Overview of noteworthy changes 1. New default framework diff --git a/docs/customization.md b/docs/customization.md index 04c3f8c..9f85f56 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -698,3 +698,33 @@ captive_portal: !remove # Removes embedded web server web_server: !remove ``` + +### Restart with 15s button press +This could be used to have an easy way to restart your panel locally in addition to the [reset pin in the bottom of your panel](pics/eu_reset_button.png). + +```yaml +binary_sensor: + # Restarts the Nextion display after pressing and holding the left button for 15s + - id: !extend left_button + on_multi_click: + - timing: + - ON for at least 15.0s + invalid_cooldown: ${invalid_cooldown} + then: # Restart the display + - switch.turn_off: screen_power + - delay: 5s + - switch.turn_on: screen_power + - delay: 2s + - lambda: disp1->soft_reset(); + - delay: 2s + - script.execute: setup_sequence + + # Restarts ESPHome after pressing and holding the right button for 15s + - id: !extend right_button + on_multi_click: + - timing: + - ON for at least 15.0s + invalid_cooldown: ${invalid_cooldown} + then: # Restart the panel + - button.press: restart_nspanel +``` diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 72e4530..3744c09 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -1582,17 +1582,6 @@ binary_sensor: page: !lambda return current_page->state.c_str(); component: "hw_bt_left" command: "short_click" - - timing: &hold_to_restart-timing - - ON for at least 15.0s - invalid_cooldown: ${invalid_cooldown} - then: - - switch.turn_off: screen_power - - delay: 5s - - switch.turn_on: screen_power - - delay: 2s - - lambda: disp1->soft_reset(); - - delay: 2s - - script.execute: setup_sequence ##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY ##### - name: Right Button @@ -1633,10 +1622,6 @@ binary_sensor: page: !lambda return current_page->state.c_str(); component: "hw_bt_right" command: "short_click" - - timing: *hold_to_restart-timing - invalid_cooldown: ${invalid_cooldown} - then: # Restart the panel - - button.press: restart_nspanel ##### Restart NSPanel Button - Setting Page ##### - name: Restart