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:
@@ -372,6 +372,40 @@ api:
|
|||||||
} else {
|
} else {
|
||||||
id(disp1).set_component_text_printf(btnbri.c_str(), " ");
|
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 to set the entities ####
|
||||||
- service: set_entity
|
- service: set_entity
|
||||||
|
|||||||
Reference in New Issue
Block a user