Skip to content

Commit 4e58a10

Browse files
committed
Simplify more
1 parent 25634be commit 4e58a10

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

adafruit_ntp.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ def __init__(
6363
self._packet = bytearray(PACKET_SIZE)
6464
self._tz_offset = int(tz_offset * 60 * 60)
6565
self._socket_timeout = socket_timeout
66-
self._connect_mode = hasattr(self._pool, "_interface") and getattr(
67-
self._pool._interface, "UDP_MODE", None
68-
)
6966

7067
# This is our estimated start time for the monotonic clock. We adjust it based on the ntp
7168
# responses.
@@ -91,10 +88,7 @@ def datetime(self) -> time.struct_time:
9188
# Since the ESP32SPI doesn't support sendto, we are using
9289
# connect + send to standardize code
9390
sock.settimeout(self._socket_timeout)
94-
if self._connect_mode:
95-
sock.connect(self._socket_address, self._connect_mode)
96-
else:
97-
sock.connect(self._socket_address)
91+
sock.connect(self._socket_address)
9892
sock.send(self._packet)
9993
sock.recv_into(self._packet)
10094
# Get the time in the context to minimize the difference between it and receiving

0 commit comments

Comments
 (0)