From f32acd86e40f71a1bc689cbb9bf9907a8256c09c Mon Sep 17 00:00:00 2001 From: Joshua King Date: Wed, 4 Mar 2026 20:20:30 -0500 Subject: [PATCH] Refactor boot sequence: adjust on_boot actions for backlight and display update; change display update interval to never; update backlight control to use GPIO --- esphome/cat-medication-tracker.yaml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/esphome/cat-medication-tracker.yaml b/esphome/cat-medication-tracker.yaml index 4123755..f2c5c90 100644 --- a/esphome/cat-medication-tracker.yaml +++ b/esphome/cat-medication-tracker.yaml @@ -6,12 +6,11 @@ esphome: name: ${name} friendly_name: ${friendly_name} on_boot: - then: - - light.turn_on: - id: backlight - brightness: 100% - - delay: 1s - - component.update: my_display + - priority: -10 + then: + - light.turn_on: backlight + - delay: 1s + - component.update: my_display esp32: board: esp32dev @@ -80,7 +79,7 @@ display: height: 320 id: my_display auto_clear_enabled: false - update_interval: 1s + update_interval: never color_palette: 8BIT lambda: |- // Colors @@ -211,12 +210,13 @@ binary_sensor: # Backlight control output: - - platform: ledc + - platform: gpio pin: GPIO21 id: backlight_pwm + inverted: false light: - - platform: monochromatic + - platform: binary output: backlight_pwm name: "${friendly_name} Backlight" id: backlight @@ -258,12 +258,6 @@ script: then: - component.update: my_display -# Keep screen refreshed in case startup sequencing misses the first draw -interval: - - interval: 2s - then: - - component.update: my_display - # Fonts font: - file: "gfonts://Roboto"