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 1c4456b commit 4a078fcCopy full SHA for 4a078fc
adafruit_ntp.py
@@ -96,13 +96,8 @@ def datetime(self) -> time.struct_time:
96
seconds = struct.unpack_from("!I", self._packet, offset=PACKET_SIZE - 8)[0]
97
98
# value should always be larger; giving a small buffer to handle jitter.
99
- if (seconds + 5) < self._monotonic_start:
100
- failed_offset = (self._monotonic_start - seconds) / 1_000_000_000
101
- raise ArithmeticError(
102
- "need a time machine, ntp time is "
103
- + str(failed_offset)
104
- + "seconds in the past."
105
- )
+ if seconds == 0:
+ raise ArithmeticError("ntp value is invalid (empty)")
106
107
self._monotonic_start = (
108
seconds
0 commit comments