diff --git a/.test/esphome_advanced_climate_heat_customizations.yaml b/.test/esphome_advanced_climate_heat_customizations.yaml index bda1da3..7227c97 100644 --- a/.test/esphome_advanced_climate_heat_customizations.yaml +++ b/.test/esphome_advanced_climate_heat_customizations.yaml @@ -133,12 +133,12 @@ script: - id: !extend page_changed then: - lambda: |- - ESP_LOGD("script.page_changed(custom)", "page: %s", page.c_str()); + ESP_LOGD("script.page_changed(custom)", "page: %s", current_page->state.c_str()); ESP_LOGV("script.page_changed(custom)", "is_on(): %s", display_light->current_values.is_on() ? "True" : "False"); - if (page == "screensaver" and display_light->current_values.is_on()) { + if (current_page->state == "screensaver" and display_light->current_values.is_on()) { auto call = display_light->turn_off(); call.perform(); - } else if (page != "screensaver" and (not display_light->current_values.is_on())) { + } else if (current_page->state != "screensaver" and (not display_light->current_values.is_on())) { auto call = display_light->turn_on(); call.perform(); } diff --git a/docs/customization.md b/docs/customization.md index fd3e241..f2e3175 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -432,12 +432,12 @@ script: - id: !extend page_changed then: - lambda: |- - ESP_LOGD("script.page_changed(custom)", "page: %s", page.c_str()); + ESP_LOGD("script.page_changed(custom)", "page: %s", current_page->state.c_str()); ESP_LOGV("script.page_changed(custom)", "is_on(): %s", display_light->current_values.is_on() ? "True" : "False"); - if (page == "screensaver" and display_light->current_values.is_on()) { + if (current_page->state == "screensaver" and display_light->current_values.is_on()) { auto call = display_light->turn_off(); call.perform(); - } else if (page != "screensaver" and (not display_light->current_values.is_on())) { + } else if (current_page->state != "screensaver" and (not display_light->current_values.is_on())) { auto call = display_light->turn_on(); call.perform(); }