From 4c2ef506bd9bfb0b37df93e09fbf7771cecbad8d Mon Sep 17 00:00:00 2001 From: monteccarlos <77864847+monteccarlos@users.noreply.github.com> Date: Fri, 18 Sep 2026 10:36:33 -0400 Subject: [PATCH] Map iot timezone index 18 to America/New_York instead of EST (#1743) Iot firmware timezone index 18 corresponds to "(UTC-05:00) Eastern Time (US & Canada)", which observes daylight saving time. Previously, this was mapped to a fixed UTC-5 (EST= causing one hour off for New York local times. Co-authored-by: monteccarlos Co-authored-by: Claude Fable 5 --- kasa/iot/iottimezone.py | 2 +- tests/iot/test_iottimezone.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kasa/iot/iottimezone.py b/kasa/iot/iottimezone.py index 46154089..309f5f95 100644 --- a/kasa/iot/iottimezone.py +++ b/kasa/iot/iottimezone.py @@ -180,7 +180,7 @@ TIMEZONE_INDEX = { 15: "Canada/Saskatchewan", 16: "America/Bogota", 17: "Etc/GMT+5", - 18: "EST", + 18: "America/New_York", 19: "America/Indiana/Indianapolis", 20: "America/Caracas", 21: "America/Asuncion", diff --git a/tests/iot/test_iottimezone.py b/tests/iot/test_iottimezone.py index ae2f24f0..31105e1c 100644 --- a/tests/iot/test_iottimezone.py +++ b/tests/iot/test_iottimezone.py @@ -14,7 +14,7 @@ def test_expected_dst_behavior_for_index_cases() -> None: assert _expected_dst_behavior_for_index(13) is True # CST6CDT # Fixed-offset or fixed-abbreviation zones assert _expected_dst_behavior_for_index(34) is False # Etc/GMT+2 - assert _expected_dst_behavior_for_index(18) is False # EST + assert _expected_dst_behavior_for_index(18) is None # America/New_York # Invalid index should raise KeyError with pytest.raises(KeyError): _expected_dst_behavior_for_index(999)