-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path303wifilc01-clock.yaml
65 lines (51 loc) · 1.16 KB
/
303wifilc01-clock.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: $devicename
includes:
- tm1650_303wifilc01.h
libraries:
- "Wire"
substitutions:
devicename: "303wifilc01-clock"
esp8266:
board: esp01_1m
logger:
level: DEBUG
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
api:
time:
- platform: homeassistant
id: homeassistant_time
custom_component:
- lambda: |-
auto tm1650 = new tm1650_component();
App.register_component(tm1650);
return {tm1650};
components:
- id: tm1650
interval:
- interval: 500ms
then:
- lambda: |-
static bool loop = true;
char buffer[6];
id(homeassistant_time).now().strftime(buffer, sizeof(buffer), "%I%M");
if(buffer[0] == '0')
buffer[0] = ' ';
((tm1650_component*) id(tm1650))->update(buffer, loop);
loop = !loop;
number:
- platform: template
id: display_intensity
name: "${devicename} Display Brightness"
initial_value: 4
min_value: 1
max_value: 8
step: 1
optimistic: true
restore_value: true
on_value:
then:
- lambda: |-
((tm1650_component*) id(tm1650))->set_intensity(x);