diff --git a/nspanel_esphome.yaml b/nspanel_esphome.yaml index a2b7f2e..956551d 100644 --- a/nspanel_esphome.yaml +++ b/nspanel_esphome.yaml @@ -386,10 +386,13 @@ api: reset_timer: bool then: - lambda: |- - if (id(current_page).state == "screensaver") id(disp1).send_command_printf("page %i", id(wakeup_page_id)); + if (id(current_page).state == "home") + { + id(disp1).send_command_printf("home.dimtimer.en=1"); + id(disp1).send_command_printf("home.sleeptimer.en=1"); + } + else if (id(current_page).state == "screensaver") id(disp1).send_command_printf("page %i", id(wakeup_page_id)); id(disp1).send_command_printf("dim=brightness"); - id(disp1).send_command_printf("home.dimtimer.en=1"); - id(disp1).send_command_printf("home.sleeptimer.en=1"); if (reset_timer) id(page_timer)->execute(int(id(page_timeout).state)); #### Service to set the entities ####