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
This commit is contained in:
Mikey Sklar 2025-08-25 16:06:37 -07:00
parent d2ae05eaed
commit cb5d1db622
3 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,6 @@
# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries
# SPDX-FileCopyrightText: 2025 Tim Cocks, written for Adafruit Industries
# SPDX-FileCopyrightText: 2025 Mikey Sklar, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
"""
@ -324,7 +325,6 @@ def _combined_tz_offset(base_default):
def _ntp_get_datetime(ntp, connect_cb, retries, delay_s, debug=False):
"""Fetch ntp.datetime with limited retries on timeout; re-connect between tries."""
last_exc = None
for i in range(retries):
last_exc = None
try:

View file

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2025 Mikey Sklar for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# Wi-Fi credentials
@ -24,10 +24,10 @@ NTP_DST = 1 # daylight saving (0=no, 1=yes)
NTP_INTERVAL = 3600 # re-sync interval (seconds)
# Optional tuning
NTP_TIMEOUT = 5 # socket timeout in seconds
NTP_TIMEOUT = "1.0" # socket timeout in seconds
NTP_CACHE_SECONDS = 0 # cache results (0 = always fetch)
NTP_REQUIRE_YEAR = 2022 # sanity check minimum year
# Retries
NTP_RETRIES = 8 # number of NTP fetch attempts
NTP_DELAY_S = 1.0 # delay between attempts (seconds)
NTP_RETRIES = 8 # number of NTP fetch attempts
NTP_DELAY_S = "1.5" # delay between attempts (seconds)

View file

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2025 Mikey Sklar for Adafruit Industries
#
# SPDX-License-Identifier: MIT
import time