We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b615e9b commit 560fcafCopy full SHA for 560fcaf
ntp_simple_demo/ntp_demo_nina.py
@@ -40,14 +40,16 @@
40
41
def try_set_time(esp, tz_offset=0):
42
# get_time will raise ValueError if the time isn't available yet.
43
- now = None
44
try:
45
- now_utc = time.localtime(esp.get_time()[0] + tz_offset)
+ now = time.localtime(esp.get_time()[0] + tz_offset)
46
except OSError:
47
return False
48
rtc.RTC().datetime = now
49
return True
50
+while not try_set_time(esp, TZ_OFFSET):
51
+ time.sleep(0.01)
52
+
53
#######################################################################
54
# Set the time, waiting until it's available
55
0 commit comments