Page Light with Power Button

Solves #1549
This commit is contained in:
Edward Firmo
2024-02-27 14:49:28 +01:00
parent c2d2bb4fe2
commit 8c8521dc23
13 changed files with 73 additions and 3 deletions

View File

@@ -838,9 +838,23 @@ display:
page_changed->execute(page_names[x]);
}
}
on_touch:
lambda: |-
timer_reset_all->execute(page_names[page_id]);
if (not id(is_uploading_tft)) {
timer_reset_all->execute(page_names[page_id]);
switch (page_id) {
case 0: // home
break;
case 10: // light
switch (component_id) {
case 34: // power_button
ha_call_service->execute("light.toggle", "", "", detailed_entity->state.c_str());
break;
}
break;
}
}
##### START - GLOBALS CONFIGURATION #####
globals: