Merge pull request #1327 from bkbartk/dev
make screen power available in HA
This commit is contained in:
@@ -93,6 +93,7 @@ packages:
|
|||||||
- 4.1.2 patch:
|
- 4.1.2 patch:
|
||||||
- Fix light icon color not being used for buttons
|
- Fix light icon color not being used for buttons
|
||||||
- Add option to wake-up to Climate page
|
- Add option to wake-up to Climate page
|
||||||
|
- New switch "Nextion display - Power" which can turn the screen on/off
|
||||||
|
|
||||||
|
|
||||||
## Details of noteworthy changes
|
## Details of noteworthy changes
|
||||||
@@ -157,6 +158,7 @@ See here: https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap
|
|||||||
- Display current temperature on buttons even when climate is off (#1268)
|
- Display current temperature on buttons even when climate is off (#1268)
|
||||||
- Button pages shows entity's icon when available (#1269)
|
- Button pages shows entity's icon when available (#1269)
|
||||||
- Home page buttons shows entity's icon when available (#1276)
|
- Home page buttons shows entity's icon when available (#1276)
|
||||||
|
- New switch "Nextion display - Power" which can turn the screen on/off (#1327)
|
||||||
|
|
||||||
## New Contributors
|
## New Contributors
|
||||||
@misery
|
@misery
|
||||||
|
|||||||
@@ -735,6 +735,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
|
||||||
@@ -1273,15 +1279,29 @@ switch:
|
|||||||
id: refresh_relays
|
id: refresh_relays
|
||||||
|
|
||||||
##### DISPLAY ALWAYS ON #####
|
##### DISPLAY ALWAYS ON #####
|
||||||
- name: ${device_name} Screen Power
|
- name: ${device_name} Nextion display - Power
|
||||||
platform: gpio
|
platform: gpio
|
||||||
id: screen_power
|
id: screen_power
|
||||||
entity_category: config
|
entity_category: diagnostic
|
||||||
pin:
|
pin:
|
||||||
number: 4
|
number: 4
|
||||||
inverted: true
|
inverted: true
|
||||||
restore_mode: ALWAYS_ON
|
restore_mode: ALWAYS_ON
|
||||||
internal: true
|
internal: false
|
||||||
|
disabled_by_default: true
|
||||||
|
on_turn_on:
|
||||||
|
- wait_until:
|
||||||
|
condition:
|
||||||
|
- lambda: !lambda return disp1->is_setup();
|
||||||
|
timeout: 20s
|
||||||
|
- lambda: |-
|
||||||
|
if (id(boot_sequence_completed)) {
|
||||||
|
nextion_init->publish_state(true);
|
||||||
|
disp1->goto_page(wakeup_page_name->state.c_str());
|
||||||
|
}
|
||||||
|
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 +2549,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 +2576,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