Enhance boot sequence: add boot_test_mode global variable; adjust backlight delay and update display logic for test mode

This commit is contained in:
Joshua King
2026-03-04 19:58:19 -05:00
parent 0c3f065f64
commit ccb50f1c37

View File

@@ -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);