Wake up panel service call (#734)

* Add service call for waking up the display

* Option to reset the sleep and page timers
This commit is contained in:
denes44
2023-04-26 23:11:05 +02:00
committed by GitHub
parent a34f51e6b6
commit f3cfa2c8ed

View File

@@ -372,6 +372,40 @@ api:
} else {
id(disp1).set_component_text_printf(btnbri.c_str(), " ");
}
##### SERVICE TO WAKE UP THE DISPLAY #####
- service: wake_up_display
variables:
option: string
then:
- if:
condition:
text_sensor.state:
id: disp1_currentpage
state: 'screensaver'
then:
- lambda: id(disp1).send_command_printf("page home");
else:
- if:
condition:
text_sensor.state:
id: disp1_currentpage
state: 'home'
then:
- lambda: id(disp1).send_command_printf("dim=brightness.val");
- if:
condition:
- lambda: 'return option == "keep_wake";'
then:
- lambda: id(disp1).send_command_printf("home.dimtimer.en=1");
- lambda: id(disp1).send_command_printf("home.sleeptimer.en=1");
- if:
condition:
- lambda: 'return option == "keep_page";'
then:
- lambda: id(disp1).send_command_printf("home.dimtimer.en=1");
- lambda: id(disp1).send_command_printf("home.sleeptimer.en=1");
- lambda: |-
id(page_timer)->execute(int(id(page_timeout).state));
#### Service to set the entities ####
- service: set_entity