Merge pull request #279 from deejaybeam/dev

upd: remove global variable touchevent
This commit is contained in:
Chris
2023-02-01 19:22:56 +01:00
committed by GitHub

View File

@@ -333,12 +333,6 @@ globals:
restore_value: no restore_value: no
initial_value: '' initial_value: ''
##### lastclick_touchevent State #####
- id: touchevent_global
type: std::string
restore_value: no
initial_value: ''
##### START - BINARY SENSOR CONFIGURATION ##### ##### START - BINARY SENSOR CONFIGURATION #####
binary_sensor: binary_sensor:
@@ -670,28 +664,27 @@ text_sensor:
##### touchevent sensor, Reset the page timeout ##### ##### touchevent sensor, Reset the page timeout #####
- platform: nextion - platform: nextion
nextion_id: disp1 nextion_id: disp1
name: ${device_name} touchevent #name: ${device_name} touchevent
id: disp1_touchevent id: disp1_touchevent
update_interval: 50ms update_interval: 50ms
component_name: touchevent component_name: touchevent
internal: true internal: true
filters: filters:
- lambda: |- - lambda: |-
if (strcmp(x.c_str(), id(touchevent_global).c_str()) != 0) { static std::string touchevent_history = "";
if (strcmp(x.c_str(), touchevent_history.c_str()) != 0) {
touchevent_history = x;
return x; return x;
// touchevent_history = "";
} else { } else {
return {}; return {};
} }
on_value: on_value:
then: then:
- globals.set:
id: touchevent_global
value: !lambda return x;
- lambda: |- - lambda: |-
id(page_timer)->execute(int(id(page_timeout).state)); id(page_timer)->execute(int(id(page_timeout).state));
##### START - SWITCH CONFIGURATION ##### ##### START - SWITCH CONFIGURATION #####
switch: switch: