Skip to content

Commit 059aeeb

Browse files
Fix formatting for Black
1 parent bef7240 commit 059aeeb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

adafruit_ntp.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
class NTP:
5050
"""Network Time Protocol (NTP) helper module for CircuitPython.
51-
This module does not handle daylight savings time.
51+
This module does not handle daylight savings or local time.
5252
5353
:param adafruit_esp32spi esp: ESP32SPI object.
5454
"""
@@ -63,15 +63,15 @@ def __init__(self, esp):
6363

6464
def set_time(self, tz_offset=0):
6565
"""Fetches and sets the microcontroller's current time
66-
in seconds since since Jan 1, 1970. Optionally offsets
67-
the current time to that of the requested timezone.
68-
69-
:param int tz_offset: Timezone offset from GMT in hours
66+
in seconds since since Jan 1, 1970.
67+
68+
:param int tz_offset: Timezone offset from GMT
7069
"""
7170
try:
7271
now = self._esp.get_time()
73-
now = time.localtime(now[0]+ (tz_offset * 3600)) # 3600 seconds in an hour
72+
now = time.localtime(now[0] + (tz_offset * 3600)) # 3600 seconds in an hour
7473
rtc.RTC().datetime = now
7574
self.valid_time = True
76-
except ValueError:
75+
except ValueError as error:
76+
print(str(error))
7777
return

0 commit comments

Comments
 (0)