forked from landonr/homeThing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tdisplayt4.yaml
executable file
·161 lines (152 loc) · 3.51 KB
/
tdisplayt4.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
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
esphome:
name: tdisplayt4
includes:
- esphomeRemote/MenuGlobals.h
- esphomeRemote/MenuTitle.h
- esphomeRemote/FriendlyNameEntity.h
- esphomeRemote/TextHelpers.h
- esphomeRemote/esphomeRemotePlayer.h
- esphomeRemote/esphomeRemoteService.h
- esphomeRemote/esphomeRemoteLight.h
- esphomeRemote/esphomeRemoteSwitch.h
- esphomeRemote/esphomeRemoteSensor.h
- esphomeRemote/DisplayUpdateInterface.h
- esphomeRemote/esphomeRemote.h
- esphomeRemote/esphomeRemoteNowPlayingMenu.h
- esphomeRemote/esphomeRemote3Button.h
esp32:
board: esp32dev
framework:
type: arduino
substitutions:
boot_name: '"Kitchen Remote <3"'
friendly_name: "Kitchen Remote"
wifi_ssid: !secret wifi_ssid
wifi_password: !secret wifi_password
wifi_fallback_password: !secret wifi_fallback_password
large_font_size: "24"
medium_font_size: "20"
small_font_size: "18"
icon_size: "24"
icon_size_large: "28"
header_height: "24"
margin_size: "8"
scroll_bar_width: "8"
bottom_bar_margin: "42"
now_playing_max_lines: "10"
draw_now_playing_menu: "true"
draw_battery_level: "false"
draw_volume_level: "false"
draw_shuffle_disabled: "false"
draw_header_time: "true"
color_accent_primary_red: 63%
color_accent_primary_green: 13%
color_accent_primary_blue: 94%
display_timeout: "16"
sleep_after: "7200"
menu_rollover_on: "false"
sync_active_player: "true"
dark_mode: "true"
<<: !include esphomeRemote/sharedRemoteConfig.yaml
sensor:
- platform: template
id: display_update_tick
filters:
- debounce: 0.02s
on_value :
then:
- lambda: |-
if(idleTime < 2) {
displayUpdate.updateDisplay(true);
}
- platform: template
name: Battery Percent
id: batteryPercent
unit_of_measurement: '%'
binary_sensor:
- platform: gpio
id: T4_BtnA
pin:
number: 39
inverted: true
on_click:
then:
- lambda: |-
buttonPressLeft();
- platform: gpio
id: T4_BtnB
pin:
number: 37
inverted: true
on_click:
then:
- lambda: |-
buttonPressSelect();
- platform: gpio
id: T4_BtnC
pin:
number: 38
inverted: true
on_click:
then:
- lambda: |-
buttonPressRight();
# We can still control the backlight independently
switch:
- platform: gpio
pin:
number: 27
inverted: false
id: comb
internal: true
- platform: gpio
pin:
number: 26
inverted: false
id: coma
internal: true
- platform: gpio
pin: GPIO4
name: "Backlight"
id: backlight
internal: true
restore_mode: RESTORE_DEFAULT_ON
- platform: template
name: Sleep Toggle
id: sleep_toggle
optimistic: true
internal: true
on_turn_on:
then:
- deep_sleep.enter:
id: deep_sleep_1
time:
- platform: homeassistant
id: esptime
spi:
clk_pin: 18
miso_pin: 12
mosi_pin: 23
display:
- platform: ili9341
id: my_display
model: TFT_2.4
cs_pin: 27
dc_pin: 32
led_pin: 04 ### see note below ###
reset_pin: 05
update_interval: 600s
rotation: 90
lambda: |-
if (idleTime < 0) {
ESP_LOGD("drawing menu", "turning on");
id(backlight).turn_on();
idleTime = 0;
} else if (!id(backlight).state) {
ESP_LOGD("drawing menu", "turning off %d", idleTime);
id(my_display).set_update_interval(60000);
return;
}
charging = true;
drawMenu();
return;