8000 Implement IOT Time Module Failover by ZeliardM · Pull Request #1583 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@ZeliardM
Copy link
Contributor
@ZeliardM ZeliardM commented Oct 8, 2025

This PR creates failover in the IOT Time Module to handle issues where the system default time zone files don't have the correct time zone info.

Copilot AI review requested due to automatic review settings October 8, 2025 20:38
Copy link
Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements failover logic for the IOT Time Module to handle cases where system default timezone files don't contain the correct timezone information. The PR adds the ability to guess timezone based on UTC offset and DST behavior when ZoneInfo is not available on the host.

  • Enhanced timezone lookup with fallback mechanisms using offset-based matching
  • Added DST behavior detection to improve timezone selection accuracy
  • Improved error handling for missing timezone data with graceful degradation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
kasa/iot/modules/time.py Updated _post_update_hook to implement failover logic with offset-based timezone guessing
kasa/iot/iottimezone.py Added new functions for DST detection, offset-based timezone guessing, and improved error handling
tests/test_common_modules.py Added comprehensive unit tests for the new failover functionality
tests/iot/test_iottimezone.py Added unit tests for the new timezone utility functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link
codecov bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.07%. Comparing base (a87926f) to head (1453bb4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1583      +/-   ##
==========================================
+ Coverage   92.82%   93.07%   +0.24%     
==========================================
  Files         157      157              
  Lines        9649     9715      +66     
  Branches      976      986      +10     
==========================================
+ Hits         8957     9042      +85     
+ Misses        492      480      -12     
+ Partials      200      193       -7     

☔ View full report in Codecov by Sentry.
📢 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.

@danielhoherd
Copy link
danielhoherd commented Oct 9, 2025

I have validated this code against my own devices and observed that it solves #1579

#1579 (comment)

@ZeliardM
Copy link
Contributor Author

This should also close out PR[#1554].

@ZeliardM
Copy link
Contributor Author

@rytilahti This looks good from my end.

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.

2 participants

0