current_page preload
This commit is contained in:
26
esphome.yaml
26
esphome.yaml
@@ -364,6 +364,11 @@ globals:
|
|||||||
restore_value: no
|
restore_value: no
|
||||||
initial_value: ''
|
initial_value: ''
|
||||||
|
|
||||||
|
##### lastclick_ccurrentpage State #####
|
||||||
|
- id: currentpage_global
|
||||||
|
type: std::string
|
||||||
|
restore_value: no
|
||||||
|
initial_value: ''
|
||||||
|
|
||||||
##### START - BINARY SENSOR CONFIGURATION #####
|
##### START - BINARY SENSOR CONFIGURATION #####
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
@@ -604,6 +609,27 @@ text_sensor:
|
|||||||
id: lastclick_climatesettings_global
|
id: lastclick_climatesettings_global
|
||||||
value: !lambda return x;
|
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 #####
|
##### START - SWITCH CONFIGURATION #####
|
||||||
switch:
|
switch:
|
||||||
|
|||||||
Reference in New Issue
Block a user