-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_node.yaml
More file actions
207 lines (180 loc) · 5.24 KB
/
Copy pathtest_node.yaml
File metadata and controls
207 lines (180 loc) · 5.24 KB
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# test_node.yaml — SentIO touch test
# Tests: tap, long press, swipe left/right/up/down
# All results printed to serial logger + shown on screen.
esphome:
name: sentio-test
friendly_name: SentIO Touch Test
esp32:
board: esp32-s3-devkitc-1
framework:
type: arduino
flash_size: 16MB
external_components:
- source:
type: local
path: components
logger:
level: DEBUG
api:
encryption:
key: !secret api_key
ota:
- platform: esphome
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# ── Hardware ──────────────────────────────────────────────────────────────────
spi:
clk_pin: GPIO12
mosi_pin: GPIO11
miso_pin: GPIO13
i2c:
sda: GPIO4
scl: GPIO8
scan: true
id: i2c_bus
output:
- platform: ledc
id: backlight_pwm
pin: GPIO38
frequency: 1000Hz
light:
- platform: monochromatic
id: backlight
name: "Backlight"
output: backlight_pwm
restore_mode: ALWAYS_ON
touchscreen:
- platform: axs15231
id: my_touch
display: my_display
i2c_id: i2c_bus
on_touch:
- lambda: |-
ESP_LOGI("touch", "Touch down: x=%d, y=%d", touch.x, touch.y);
on_release:
- lambda: |-
ESP_LOGI("touch", "Touch released");
display:
- platform: ili9xxx
model: ST7796
id: my_display
cs_pin: GPIO10
dc_pin: GPIO14
reset_pin: GPIO15
invert_colors: false
dimensions:
width: 320
height: 480
update_interval: never
# ── LVGL — widgets defined here, no on_boot lambda needed ────────────────────
lvgl:
displays:
- my_display
touchscreens:
- my_touch
buffer_size: 25%
widgets:
- obj:
width: 320
height: 480
bg_color: 0x0D1117
border_width: 0
pad_all: 0
widgets:
# Status label — updated by every touch event
- label:
id: lbl_status
x: 20
y: 20
text: "Waiting for touch..."
text_color: 0x8B949E
text_font: MONTSERRAT_16
# ── TAP / LONG-PRESS button ───────────────────────────────────────
- button:
id: btn_main
x: 20
y: 60
width: 280
height: 100
bg_color: 0x21262D
border_color: 0x30363D
border_width: 1
radius: 8
widgets:
- label:
text: "TAP or HOLD ME"
text_color: 0xE6EDF0
align: CENTER
on_click:
- logger.log: ">>> TAP"
- lvgl.label.update:
id: lbl_status
text: "TAP ✓"
on_long_press:
- logger.log: ">>> LONG PRESS"
- lvgl.label.update:
id: lbl_status
text: "LONG PRESS ✓"
# ── Reset button ──────────────────────────────────────────────────
- button:
id: btn_reset
x: 20
y: 180
width: 280
height: 100
bg_color: 0x161B22
border_color: 0x30363D
border_width: 1
radius: 8
widgets:
- label:
text: "RESET"
text_color: 0x8B949E
align: CENTER
on_click:
- logger.log: ">>> RESET"
- lvgl.label.update:
id: lbl_status
text: "Waiting for touch..."
# ── Swipe hint label ──────────────────────────────────────────────
- label:
x: 20
y: 300
text: "Swipe anywhere on screen →"
text_color: 0x30363D
text_font: MONTSERRAT_14
# ── SentIO — handles swipes ───────────────────────────────────────────────────
sentio:
id: my_sentio
touch_source: my_touch
backlight_light: backlight
sleep_timeout: 300s
suppress_wake_click: true
soft_sleep_only: false
long_press_time: 500ms
on_swipe_left:
- logger.log: ">>> SWIPE LEFT"
- lvgl.label.update:
id: lbl_status
text: "SWIPE LEFT ✓"
on_swipe_right:
- logger.log: ">>> SWIPE RIGHT"
- lvgl.label.update:
id: lbl_status
text: "SWIPE RIGHT ✓"
on_swipe_up:
- logger.log: ">>> SWIPE UP"
- lvgl.label.update:
id: lbl_status
text: "SWIPE UP ✓"
on_swipe_down:
- logger.log: ">>> SWIPE DOWN"
- lvgl.label.update:
id: lbl_status
text: "SWIPE DOWN ✓"
on_sleep:
- logger.log: "Screen sleeping"
on_wake:
- logger.log: "Screen woke up"