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,10 +6,9 @@ esphome:
|
|||||||
name: ${name}
|
name: ${name}
|
||||||
friendly_name: ${friendly_name}
|
friendly_name: ${friendly_name}
|
||||||
on_boot:
|
on_boot:
|
||||||
|
- priority: -10
|
||||||
then:
|
then:
|
||||||
- light.turn_on:
|
- light.turn_on: backlight
|
||||||
id: backlight
|
|
||||||
brightness: 100%
|
|
||||||
- delay: 1s
|
- delay: 1s
|
||||||
- component.update: my_display
|
- component.update: my_display
|
||||||
|
|
||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user