Refactor boot sequence: adjust on_boot actions for backlight and display update; change display update interval to never; update backlight control to use GPIO

This commit is contained in:
Joshua King
2026-03-04 20:20:30 -05:00
parent 45c9186f25
commit f32acd86e4

View File

@@ -6,12 +6,11 @@ esphome:
name: ${name} name: ${name}
friendly_name: ${friendly_name} friendly_name: ${friendly_name}
on_boot: on_boot:
then: - priority: -10
- light.turn_on: then:
id: backlight - light.turn_on: backlight
brightness: 100% - delay: 1s
- delay: 1s - component.update: my_display
- component.update: my_display
esp32: esp32:
board: esp32dev board: esp32dev
@@ -80,7 +79,7 @@ display:
height: 320 height: 320
id: my_display id: my_display
auto_clear_enabled: false auto_clear_enabled: false
update_interval: 1s update_interval: never
color_palette: 8BIT color_palette: 8BIT
lambda: |- lambda: |-
// Colors // Colors
@@ -211,12 +210,13 @@ binary_sensor:
# Backlight control # Backlight control
output: output:
- platform: ledc - platform: gpio
pin: GPIO21 pin: GPIO21
id: backlight_pwm id: backlight_pwm
inverted: false
light: light:
- platform: monochromatic - platform: binary
output: backlight_pwm output: backlight_pwm
name: "${friendly_name} Backlight" name: "${friendly_name} Backlight"
id: backlight id: backlight
@@ -258,12 +258,6 @@ script:
then: then:
- component.update: my_display - component.update: my_display
# Keep screen refreshed in case startup sequencing misses the first draw
interval:
- interval: 2s
then:
- component.update: my_display
# Fonts # Fonts
font: font:
- file: "gfonts://Roboto" - file: "gfonts://Roboto"