touchevent
This commit is contained in:
@@ -327,12 +327,18 @@ globals:
|
|||||||
restore_value: no
|
restore_value: no
|
||||||
initial_value: ''
|
initial_value: ''
|
||||||
|
|
||||||
##### lastclick_ccurrentpage State #####
|
##### lastclick_currentpage State #####
|
||||||
- id: currentpage_global
|
- id: currentpage_global
|
||||||
type: std::string
|
type: std::string
|
||||||
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:
|
||||||
|
|
||||||
@@ -661,6 +667,31 @@ text_sensor:
|
|||||||
id(page_timer)->execute(int(id(page_timeout).state));
|
id(page_timer)->execute(int(id(page_timeout).state));
|
||||||
|
|
||||||
|
|
||||||
|
##### touchevent sensor, Reset the page timeout #####
|
||||||
|
- platform: nextion
|
||||||
|
nextion_id: disp1
|
||||||
|
name: ${device_name} touchevent
|
||||||
|
id: disp1_touchevent
|
||||||
|
update_interval: 50ms
|
||||||
|
component_name: touchevent
|
||||||
|
internal: true
|
||||||
|
filters:
|
||||||
|
- lambda: |-
|
||||||
|
if (strcmp(x.c_str(), id(touchevent_global).c_str()) != 0) {
|
||||||
|
return x;
|
||||||
|
} else {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
on_value:
|
||||||
|
then:
|
||||||
|
- globals.set:
|
||||||
|
id: touchevent_global
|
||||||
|
value: !lambda return x;
|
||||||
|
- lambda: |-
|
||||||
|
id(page_timer)->execute(int(id(page_timeout).state));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
##### START - SWITCH CONFIGURATION #####
|
##### START - SWITCH CONFIGURATION #####
|
||||||
switch:
|
switch:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user