-
Notifications
You must be signed in to change notification settings - Fork 3
/
SDL-lvgl-display_modular.yaml
114 lines (99 loc) · 4.06 KB
/
SDL-lvgl-display_modular.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Substitution variables used through the codebase
substitutions:
lightbulb: "\U000F0335"
ceiling_light: "\U000F0769"
lamp: "\U000F06B5"
floor_lamp: "\U000F08DD"
string_lights: "\U000F12BA"
track_light: "\U000F0914"
bulkhead_light: "\U000F1A2F"
led_strip: "\U000F07D6"
coach_lamp: "\U000F1020"
ceiling_fan_light: "\U000F1798"
icon_font: light40
text_font: roboto24
screen_height: '480px'
screen_width: '480px'
sdl_height: '480'
sdl_width: '480'
button_on_color: "burnt_sienna"
button_off_color: "very_dark_gray"
icon_on_color: "yellow"
icon_off_color: "gray"
label_on_color: "white"
label_off_color: "gray"
button_text_color: "white"
button_height_single: '109px'
button_height_double: '228px'
button_width: '150px'
touchscreen_idle_timeout: "120s"
touchscreen_daytime_brightness: "100%"
touchscreen_nighttime_brightness: "50%"
# Screen goes to sleep at Mightnight
screen_sleep_hour: '0'
screen_sleep_minute: '0'
# Screen wakes up at 5:30am
screen_wake_hour: '5'
screen_wake_minute: '30'
# Button 1 is a local relay
button_1_name: "Button 1"
button_1_id: button_one
button_1_icon: $lightbulb
button_1_device: "switch.athom_smart_plug_v3_50ebc0_switch"
# Button 2 is a switch (some devcies show up as switches some as lights make sure you use the corresponding file)
button_2_name: "Button 2"
button_2_id: couch_lamp
button_2_icon: $lightbulb
button_2_device: "switch.athom_smart_plug_v3_50ebc0_switch"
# Button 3 is an empty object that requires no settings. It just pushes everything down one button
# Button 4 is dimmable light
button_4_name: "RGB light"
button_4_id: rgb_light
button_4_icon: $string_lights
button_4_device: light.athom_rgb_light_d93662_rgb_light_strip
esphome:
name: "sdl-lvgl"
friendly_name: "SDL test system"
comment: "SDL test 480px * 480px Smart Screen"
packages:
# Generic configuration for ESP32 screens
base: !include modules/common/base.yaml
globals: !include modules/common/globals.yaml
# SDL has no Wi-Fi
# wifi: !include modules/common/wifi.yaml
colors: !include modules/common/color.yaml
fonts: !include modules/common/fonts.yaml
images: !include modules/common/images.yaml
# Harware description file
hardware: !include modules/hardware/SDL-lvgl.yaml
# Base settings for LVGL libary
lvgl_time: !include modules/lvgl/base/lvgl_time_homeassistant.yaml
lvgl_sensors: !include modules/lvgl/base/lvgl_sensors_base-SDL.yaml
lvgl_base: !include modules/lvgl/base/lvgl_base.yaml
# Update button and relay state from Home Assistant
button_1_sensor: !include { file: modules/sensors/basic_switch_or_light_button_state.yaml, vars: { id: 1 } }
button_2_sensor: !include { file: modules/sensors/basic_switch_or_light_button_state.yaml, vars: { id: 2 } }
button_4_sensor: !include { file: modules/sensors/dimmer_light_state.yaml, vars: { id: 4 } }
# -------------------------------------------------------------------------
# LVGL pages and buttons
# -------------------------------------------------------------------------
lvgl:
theme: !include { file: modules/lvgl/base/lvgl_theme.yaml }
page_wrap: true
# Boot screen
top_layer: !include { file: modules/lvgl/screens/boot_screen.yaml, vars: { height: $screen_height, width: $screen_width } }
# Main Page
pages:
- id: main_page
layout:
type: flex
flex_flow: COLUMN_WRAP
width: 100%
bg_color: black
bg_opa: cover
pad_all: 5
widgets: # Include all the buttons
- button: !include { file: modules/lvgl/buttons/basic_switch_button.yaml, vars: { id: 1, height: $button_height_single } }
- button: !include { file: modules/lvgl/buttons/basic_switch_button.yaml, vars: { id: 2, height: $button_height_single } }
- button: !include { file: modules/lvgl/buttons/transparent_empty_button.yaml, vars: { id: 3, height: $button_height_single } }
- button: !include { file: modules/lvgl/buttons/dimmer_light_button.yaml, vars: { id: 4, height: $button_height_double } }