diff --git a/.test/esphome_advanced_climate_heat_customizations.yaml b/.test/esphome_advanced_climate_heat_customizations.yaml index 7227c97..2d94bb0 100644 --- a/.test/esphome_advanced_climate_heat_customizations.yaml +++ b/.test/esphome_advanced_climate_heat_customizations.yaml @@ -26,7 +26,7 @@ binary_sensor: id: display_state platform: template lambda: |- - return (id(current_page).state != "screensaver"); + return (current_page->state != "screensaver"); # Enable Bluetooth proxy bluetooth_proxy: @@ -41,7 +41,7 @@ button: then: - logger.log: Button Sleep pressed - lambda: |- - if (id(current_page).state != "screensaver") id(disp1).goto_page("screensaver"); + goto_page->execute("screensaver"); # Adds a button to wake-up the panel (similar to the existing service) - name: ${device_name} Wake-up @@ -52,10 +52,10 @@ button: then: - logger.log: Button Wake-up pressed - lambda: |- - if (id(current_page).state == "screensaver") id(disp1).goto_page(id(wakeup_page_name).state.c_str()); - // id(timer_page).execute(id(wakeup_page_name).state.c_str()); // enable this if you want page timeout to be reset - id(timer_sleep).execute(id(wakeup_page_name).state.c_str(), int(id(timeout_sleep).state)); - id(timer_dim).execute(id(wakeup_page_name).state.c_str(), int(id(timeout_dim).state)); + if (current_page->state == "screensaver") id(disp1).goto_page(id(wakeup_page_name).state.c_str()); + // timer_page->execute(); // enable this if you want page timeout to be reset + timer_sleep->execute(); + timer_dim->execute(); # Add custom presets to your climate (heat in this example) climate: @@ -100,12 +100,12 @@ light: - lambda: |- ESP_LOGD("light.display_light", "Turn-on"); if (current_page->state == "screensaver") disp1->goto_page(wakeup_page_name->state.c_str()); - timer_reset_all->execute(wakeup_page_name->state.c_str()); + timer_reset_all->execute(); on_turn_off: then: - lambda: |- ESP_LOGD("light.display_light", "Turn-off"); - disp1->goto_page("screensaver"); + goto_page->execute("screensaver"); logger: # Enable hardware UART serial logging diff --git a/docs/customization.md b/docs/customization.md index f2e3175..bc1e18b 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -288,7 +288,7 @@ binary_sensor: id: display_state platform: template lambda: |- - return (id(current_page).state != "screensaver"); + return (current_page->state != "screensaver"); ``` You can easily invert the meaning to have a sensor for display sleeping: @@ -300,7 +300,7 @@ binary_sensor: id: display_sleeping platform: template lambda: |- - return (id(current_page).state == "screensaver"); + return (current_page->state == "screensaver"); ``` ### Deep sleep @@ -373,7 +373,7 @@ button: then: - logger.log: Button Sleep pressed - lambda: |- - if (id(current_page).state != "screensaver") id(disp1).goto_page("screensaver"); + goto_page->execute("screensaver"); # Adds a button to wake-up the panel (similar to the existing service) - name: Wake-up @@ -384,10 +384,10 @@ button: then: - logger.log: Button Wake-up pressed - lambda: |- - if (id(current_page).state == "screensaver") id(disp1).goto_page(id(wakeup_page_name).state.c_str()); - // id(timer_page).execute(id(wakeup_page_name).state.c_str()); // enable this if you want page timeout to be reset - id(timer_sleep).execute(id(wakeup_page_name).state.c_str(), int(id(timeout_sleep).state)); - id(timer_dim).execute(id(wakeup_page_name).state.c_str(), int(id(timeout_dim).state)); + if (current_page->state == "screensaver") id(disp1).goto_page(id(wakeup_page_name).state.c_str()); + // timer_page->execute(); // enable this if you want page timeout to be reset + timer_sleep->execute(); + timer_dim->execute(); ``` ### Set display as a light @@ -408,12 +408,12 @@ light: - lambda: |- ESP_LOGD("light.display_light", "Turn-on"); if (current_page->state == "screensaver") disp1->goto_page(wakeup_page_name->state.c_str()); - timer_reset_all->execute(wakeup_page_name->state.c_str()); + timer_reset_all->execute(); on_turn_off: then: - lambda: |- ESP_LOGD("light.display_light", "Turn-off"); - disp1->goto_page("screensaver"); + goto_page->execute("screensaver"); output: # Output required by `display_light` to send the commands to Nextion diff --git a/hmi/dev/create_us_land_and_CJK_hmi_from_original.md b/hmi/dev/create_us_land_and_CJK_hmi_from_original.md index 1070c7f..dc37bfa 100644 --- a/hmi/dev/create_us_land_and_CJK_hmi_from_original.md +++ b/hmi/dev/create_us_land_and_CJK_hmi_from_original.md @@ -5,6 +5,9 @@ - **Program.s:** - Change to `display_mode=3` +- **Page boot:** + - Change component `progress` (the progress bar in the very bottom) width to 480. + ## Creating `nspanel_CJK_xxx.HMI` from `nspanel_xxx.HMI` - **Program.s:** diff --git a/hmi/nspanel_us_land.HMI b/hmi/nspanel_us_land.HMI index 35b2155..9d540e2 100644 Binary files a/hmi/nspanel_us_land.HMI and b/hmi/nspanel_us_land.HMI differ diff --git a/hmi/nspanel_us_land.tft b/hmi/nspanel_us_land.tft index 8e7a8e7..6550896 100644 Binary files a/hmi/nspanel_us_land.tft and b/hmi/nspanel_us_land.tft differ