Update customizations
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:**
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user