We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2495e3 commit a923944Copy full SHA for a923944
adafruit_ntp.py
@@ -103,13 +103,8 @@ def datetime(self) -> time.struct_time:
103
seconds = struct.unpack_from("!I", self._packet, offset=PACKET_SIZE - 8)[0]
104
105
# value should always be larger; giving a small buffer to handle jitter.
106
- if (seconds + 5) < self._monotonic_start:
107
- failed_offset = (self._monotonic_start - seconds) / 1_000_000_000
108
- raise ArithmeticError(
109
- "need a time machine, ntp time is "
110
- + str(failed_offset)
111
- + "seconds in the past."
112
- )
+ if seconds == 0:
+ raise ArithmeticError("ntp value is invalid (empty)")
113
114
self._monotonic_start = (
115
seconds
0 commit comments