From ccb50f1c37f004181c3501b3b5f2f3fb2125832f Mon Sep 17 00:00:00 2001 From: Joshua King Date: Wed, 4 Mar 2026 19:58:19 -0500 Subject: [PATCH] Enhance boot sequence: add boot_test_mode global variable; adjust backlight delay and update display logic for test mode --- esphome/cat-medication-tracker.yaml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/esphome/cat-medication-tracker.yaml b/esphome/cat-medication-tracker.yaml index 780d7b1..53f0f48 100644 --- a/esphome/cat-medication-tracker.yaml +++ b/esphome/cat-medication-tracker.yaml @@ -2,15 +2,27 @@ substitutions: name: cat-medication-tracker friendly_name: "Cat Medication Tracker" +globals: + - id: boot_test_mode + type: bool + restore_value: false + initial_value: 'true' + esphome: name: ${name} friendly_name: ${friendly_name} on_boot: - priority: -10 - then: - - light.turn_on: backlight - - delay: 1s - - component.update: my_display + - priority: -10 + then: + - light.turn_on: backlight + - delay: 300ms + - lambda: |- + id(boot_test_mode) = true; + - component.update: my_display + - delay: 1s + - lambda: |- + id(boot_test_mode) = false; + - component.update: my_display esp32: board: esp32dev @@ -79,9 +91,14 @@ display: height: 320 id: my_display auto_clear_enabled: false - update_interval: 2s + update_interval: never color_palette: 8BIT lambda: |- + if (id(boot_test_mode)) { + it.fill(Color(0, 128, 255)); + return; + } + // Colors auto red = Color(255, 0, 0); auto green = Color(0, 200, 0);