fix: current_page does not exist anymore

This commit is contained in:
deejaybeam
2023-04-26 23:39:35 +02:00
parent 89ad6426ed
commit f609e92c0d

View File

@@ -377,21 +377,17 @@ api:
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");
- lambda: |-
DynamicJsonDocument doc(1024);
deserializeJson(doc, id(disp1_nspanel_event).state);
std::string page = doc["page"];
if (page == "screensaver") {
id(disp1).send_command_printf("page home");
} else {
if (page == "home"){
id(disp1).send_command_printf("dim=brightness.val");
}
}
- if:
condition:
- lambda: 'return option == "keep_wake";'