current_page preload

This commit is contained in:
Blackymas
2022-11-17 09:49:58 +01:00
parent 49eac7283e
commit 479396fa46

View File

@@ -364,6 +364,11 @@ globals:
restore_value: no
initial_value: ''
##### lastclick_ccurrentpage State #####
- id: currentpage_global
type: std::string
restore_value: no
initial_value: ''
##### START - BINARY SENSOR CONFIGURATION #####
binary_sensor:
@@ -604,6 +609,27 @@ text_sensor:
id: lastclick_climatesettings_global
value: !lambda return x;
##### currentpage sensor, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} current Page New
id: disp1_currentpage_new
update_interval: 50ms
component_name: current_p_va
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(currentpage_global).c_str()) != 0) {
return x;
} else {
return {};
}
on_value:
then:
- globals.set:
id: currentpage_global
value: !lambda return x;
##### START - SWITCH CONFIGURATION #####
switch: