Merge pull request #737 from deejaybeam/dev
fix: current_page does not extist anymore
This commit is contained in:
@@ -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";'
|
||||
|
||||
Reference in New Issue
Block a user