Skip to content

Commit

Permalink
PR feedback, test zero
Browse files Browse the repository at this point in the history
  • Loading branch information
tedder committed Jul 23, 2024
1 parent f2495e3 commit a923944
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions adafruit_ntp.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,8 @@ def datetime(self) -> time.struct_time:
seconds = struct.unpack_from("!I", self._packet, offset=PACKET_SIZE - 8)[0]

# value should always be larger; giving a small buffer to handle jitter.
if (seconds + 5) < self._monotonic_start:
failed_offset = (self._monotonic_start - seconds) / 1_000_000_000
raise ArithmeticError(
"need a time machine, ntp time is "
+ str(failed_offset)
+ "seconds in the past."
)
if seconds == 0:
raise ArithmeticError("ntp value is invalid (empty)")

self._monotonic_start = (
seconds
Expand Down

0 comments on commit a923944

Please sign in to comment.