Set display not available when power off
This commit is contained in:
@@ -345,10 +345,8 @@ api:
|
|||||||
disp1->set_component_text_printf("boot.bluep_version", "%s", blueprint_version.c_str());
|
disp1->set_component_text_printf("boot.bluep_version", "%s", blueprint_version.c_str());
|
||||||
- wait_until:
|
- wait_until:
|
||||||
condition:
|
condition:
|
||||||
- not:
|
- lambda: |-
|
||||||
- text_sensor.state: # Is boot page visible?
|
return (id(boot_sequence_completed) or current_page->state != "boot");
|
||||||
id: current_page
|
|
||||||
state: 'boot'
|
|
||||||
timeout: 2s
|
timeout: 2s
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
@@ -735,6 +733,12 @@ display:
|
|||||||
##### START - GLOBALS CONFIGURATION #####
|
##### START - GLOBALS CONFIGURATION #####
|
||||||
globals:
|
globals:
|
||||||
|
|
||||||
|
##### Is boot sequence completed? #####
|
||||||
|
- id: boot_sequence_completed
|
||||||
|
type: bool
|
||||||
|
restore_value: false
|
||||||
|
initial_value: 'false'
|
||||||
|
|
||||||
###### Last volume level from Home Assistant ######
|
###### Last volume level from Home Assistant ######
|
||||||
- id: last_volume_level
|
- id: last_volume_level
|
||||||
type: uint
|
type: uint
|
||||||
@@ -1281,7 +1285,13 @@ switch:
|
|||||||
number: 4
|
number: 4
|
||||||
inverted: true
|
inverted: true
|
||||||
restore_mode: ALWAYS_ON
|
restore_mode: ALWAYS_ON
|
||||||
# internal: true
|
internal: false
|
||||||
|
on_turn_on:
|
||||||
|
- lambda: |-
|
||||||
|
if (id(boot_sequence_completed)) boot_sequence->execute();
|
||||||
|
on_turn_off:
|
||||||
|
- lambda: |-
|
||||||
|
nextion_init->publish_state(false);
|
||||||
|
|
||||||
##### Relay Local control #####
|
##### Relay Local control #####
|
||||||
- name: ${device_name} Relay 1 Local
|
- name: ${device_name} Relay 1 Local
|
||||||
@@ -2529,7 +2539,7 @@ script:
|
|||||||
{"type", "boot"},
|
{"type", "boot"},
|
||||||
{"step", "start"}
|
{"step", "start"}
|
||||||
});
|
});
|
||||||
delay(1000);
|
if (!id(boot_sequence_completed)) delay(1000);
|
||||||
// Set dimming values
|
// Set dimming values
|
||||||
display_brightness->publish_state(id(display_brightness_global));
|
display_brightness->publish_state(id(display_brightness_global));
|
||||||
display_dim_brightness->publish_state(id(display_dim_brightness_global));
|
display_dim_brightness->publish_state(id(display_dim_brightness_global));
|
||||||
@@ -2556,6 +2566,7 @@ script:
|
|||||||
disp1->set_component_text_printf("home.icon_top_02", "%s", id(home_relay2_icon).c_str());
|
disp1->set_component_text_printf("home.icon_top_02", "%s", id(home_relay2_icon).c_str());
|
||||||
timer_reset_all->execute("boot");
|
timer_reset_all->execute("boot");
|
||||||
notification_clear->execute();
|
notification_clear->execute();
|
||||||
|
id(boot_sequence_completed) = true;
|
||||||
ESP_LOGD(TAG, "Boot sequence finished!");
|
ESP_LOGD(TAG, "Boot sequence finished!");
|
||||||
|
|
||||||
- id: notification_clear
|
- id: notification_clear
|
||||||
|
|||||||
Reference in New Issue
Block a user