Exit notification page with notification clear

Solves #1931
This commit is contained in:
Edward Firmo
2024-03-18 18:55:02 +01:00
parent 9059b20773
commit 54a4e7775f

View File

@@ -502,6 +502,7 @@ api:
- service: notification_clear
then:
- lambda: |-
if (current_page->state == "notification") goto_page->execute("home");
notification_label->publish_state("");
notification_text->publish_state("");
notification_unread->turn_off();
@@ -2808,7 +2809,9 @@ script:
then:
- delay: !lambda return (int(timeout_page->state) *1000);
- lambda: |-
#if ESPHOME_LOG_LEVEL > ESPHOME_LOG_LEVEL_DEBUG
ESP_LOGV("script.timer_page", "Timed out on page: %s", current_page->state.c_str());
#endif
if (timeout_page->state >= 1 and
current_page->state != "boot" and
current_page->state != "confirm" and