Skip to content

Commit 1ab4cff

Browse files
authored
Update childrens-clock.yaml
1 parent 5697284 commit 1ab4cff

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

childrens-clock.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ logger:
7272
level: DEBUG
7373
baud_rate: 460800
7474

75+
globals:
76+
- id: timezone_applied
77+
type: bool
78+
restore_value: false
79+
initial_value: "false"
80+
7581
button:
7682
- platform: factory_reset
7783
disabled_by_default: true
@@ -170,6 +176,15 @@ time:
170176
- light.turn_on:
171177
id: led_matrix_light
172178
brightness: 0.1
179+
- if:
180+
condition:
181+
- lambda: 'return !id(timezone_applied);'
182+
then:
183+
- lambda: |-
184+
id(sntp_time).set_timezone(id(tz).state);
185+
id(sntp_time).call_setup();
186+
id(timezone_applied) = true;
187+
173188
font:
174189
- id: tinyfont
175190
file: "lexis.ttf"
@@ -242,6 +257,9 @@ text:
242257
optimistic: yes
243258
initial_value: "GMT0"
244259
restore_value: true
260+
on_value:
261+
then:
262+
- lambda: 'id(timezone_applied) = false;'
245263

246264
light:
247265
- platform: esp32_rmt_led_strip

0 commit comments

Comments
 (0)