-
Notifications
You must be signed in to change notification settings - Fork 12
/
demo.yaml
65 lines (54 loc) · 1.31 KB
/
demo.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
esphome:
name: "hdmi-cec-demo"
external_components:
- source:
type: local
path: components
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret encryption_key
services:
- service: hdmi_cec_send
variables:
cec_source: int
cec_destination: int
cec_data: int[]
then:
- hdmi_cec.send:
source: !lambda 'return static_cast<unsigned char>(cec_source);'
destination: !lambda 'return static_cast<unsigned char>(cec_destination);'
data: !lambda 'std::vector<unsigned char> charVector; for (int i : cec_data) { charVector.push_back(static_cast<unsigned char>(i)); } return charVector;'
# Enable OTA
ota:
password: !secret mgmt_pass
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: True
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
captive_portal:
hdmi_cec:
pin: GPIO26
address: 0x5
physical_address: 0x4000
on_message:
# Volume Up
- data: [0x44, 0x41]
then:
logger.log: "Volume Up"
# Volume Down
- data: [0x44, 0x42]
then:
logger.log: "Volume Down"
# Mute
- data: [0x44, 0x43]
then:
- logger.log: "Mute"