Skip to content

Commit cb5d1db

Browse files
committed
settings.toml float quote, attribution, duplicate last_exc setting
settings.toml example with double quotes for floating point values mikeysklar attribution drop duplicate last_exc
1 parent d2ae05e commit cb5d1db

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

adafruit_fruitjam/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries
22
# SPDX-FileCopyrightText: 2025 Tim Cocks, written for Adafruit Industries
3+
# SPDX-FileCopyrightText: 2025 Mikey Sklar, written for Adafruit Industries
34
#
45
# SPDX-License-Identifier: Unlicense
56
"""
@@ -324,7 +325,6 @@ def _combined_tz_offset(base_default):
324325

325326
def _ntp_get_datetime(ntp, connect_cb, retries, delay_s, debug=False):
326327
"""Fetch ntp.datetime with limited retries on timeout; re-connect between tries."""
327-
last_exc = None
328328
for i in range(retries):
329329
last_exc = None
330330
try:

examples/fruitjam_ntp_settings.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Mikey Sklar for Adafruit Industries
22
#
33
# SPDX-License-Identifier: MIT
44
# Wi-Fi credentials
@@ -24,10 +24,10 @@ NTP_DST = 1 # daylight saving (0=no, 1=yes)
2424
NTP_INTERVAL = 3600 # re-sync interval (seconds)
2525

2626
# Optional tuning
27-
NTP_TIMEOUT = 5 # socket timeout in seconds
27+
NTP_TIMEOUT = "1.0" # socket timeout in seconds
2828
NTP_CACHE_SECONDS = 0 # cache results (0 = always fetch)
2929
NTP_REQUIRE_YEAR = 2022 # sanity check minimum year
3030

3131
# Retries
32-
NTP_RETRIES = 8 # number of NTP fetch attempts
33-
NTP_DELAY_S = 1.0 # delay between attempts (seconds)
32+
NTP_RETRIES = 8 # number of NTP fetch attempts
33+
NTP_DELAY_S = "1.5" # delay between attempts (seconds)

examples/fruitjam_time_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
1+
# SPDX-FileCopyrightText: Copyright (c) 2025 Mikey Sklar for Adafruit Industries
22
#
33
# SPDX-License-Identifier: MIT
44
import time

0 commit comments

Comments
 (0)