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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user