| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
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.
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.
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #1583 +/- ##
==========================================
+ Coverage 92.98% 93.22% +0.24%
==========================================
Files 157 157
Lines 9750 9815 +65
Branches 992 1002 +10
==========================================
+ Hits 9066 9150 +84
+ Misses 484 472 -12
+ Partials 200 193 -7 ☔ View full report in Codecov by Sentry.
|
Sorry, something went wrong.
|
I have validated this code against my own devices and observed that it solves #1579 |
Sorry, something went wrong.
|
This should also close out PR[#1554]. |
Sorry, something went wrong.
|
@rytilahti This looks good from my end. |
Sorry, something went wrong.
There was a problem hiding this comment.
Did a very quick review, but I trust you this makes sense. Added a couple of very minor nits, feel free to adjust or just let me know and we will merge this as-is.
Sorry, something went wrong.
|
@rytilahti Yea, what this does is it takes what the SMART devices does for fallback and implements it into the IOT devices as well. The fallback for SMART and SMARTCAM devices uses the built-in offset from the device, which IOT does not have, so we calculate it here based on the device and system time to a best guess. It's not perfect but gets rid of the failures that were happening and gives a path to keep going without the hard failures like before without the TZDATA modules and with the changes to the base system time zones. This should be cleaned up according to your comments and good to go now as well. |
Sorry, something went wrong.
|
Sounds good to me, let's merge! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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.