FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Map iot timezone index 18 to America/New_York instead of EST by monteccarlos · Pull Request #1743 · python-kasa/python-kasa · GitHub

Map iot timezone index 18 to America/New_York instead of EST - #1743

Open
monteccarlos wants to merge 1 commit into
python-kasa:masterfrom
monteccarlos:fix/iot-tz-index-18-eastern-dst
Open

Map iot timezone index 18 to America/New_York instead of EST#1743
monteccarlos wants to merge 1 commit into
python-kasa:masterfrom
monteccarlos:fix/iot-tz-index-18-eastern-dst

Conversation

Copy link
Copy Markdown

Description

Iot firmware timezone index 18 corresponds to "(UTC-05:00) Eastern Time (US & Canada)", which observes daylight saving time. TIMEZONE_INDEX currently maps it to EST, a fixed UTC-5 zone that never applies DST — so devices set to US Eastern time (e.g. a KL125 hw 4.0 in New York) get local times one hour off for roughly eight months of the year, and get_timezone_index(ZoneInfo("America/New_York")) cannot round-trip to index 18.

The neighboring entries support this reading: index 6 is PST8PDT (Pacific with DST) and 13 is CST6CDT (Central with DST), while the fixed -5 offset already has its own entry at 17 (Etc/GMT+5). EST at 18 looks like it was meant to be the DST-observing Eastern entry.

As a side benefit, America/New_York is a canonical IANA key, unlike EST, which is missing from trimmed tzdata installations (Debian 13 without tzdata-legacy — the crash reported in #1579/#1620, now handled gracefully by the failover from #1583, but the failover then guesses with dst_expected=False for this index, cementing the wrong offset in summer).

Related issues: #1579, #1508, #1467, #1620. A similar change was proposed in #1554 (America/Toronto) and closed when #1583 fixed the crash; this PR addresses the remaining DST-correctness issue rather than the crash.

The test asserting index 18 is non-DST (tests/iot/test_iottimezone.py) is updated: the key heuristic returns None (unknown) for America/New_York, letting _guess_timezone_by_offset consider DST-observing candidates.

Checklist

  • Tests updated (tests/iot/test_iottimezone.py — 13 passed locally, plus 182 time/tz-related tests in test_common_modules.py)

🤖 Generated with Claude Code

Index 18 in the iot firmware timezone list corresponds to
"(UTC-05:00) Eastern Time (US & Canada)", which observes daylight
saving time. The fixed-offset EST key never applies DST, so devices
configured for US Eastern time report times one hour off during the
DST period. EST is also absent from trimmed tzdata installations
(e.g. Debian 13 without tzdata-legacy).

Related: python-kasa#1579, python-kasa#1508, python-kasa#1467, python-kasa#1620

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

codecov Bot commented Aug 23, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.28%. Comparing base (a29d061) to head (2719fd0).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1743      +/-   ##
==========================================
- Coverage   93.29%   93.28%   -0.02%     
==========================================
  Files         157      157              
  Lines        9932     9932              
  Branches     1022     1022              
==========================================
- Hits         9266     9265       -1     
- Misses        471      472       +1     
  Partials      195      195              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL