GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||
GeezerVison is showing github.com — Add thermostat schedule, temperature source and history modules by o-gent · Pull Request #1806 · python-kasa/python-kasa Conversation
Contributor
Adds support for the KE100/KE110 thermostat schedule, which was asked for in #1601, along with a few other components these thermostats and the T310/T315 sensors report but python-kasa didn't support yet. New modules
The request names and parameters ( Device behaviour worth knowing
Fix: hub child module data lost on partial updates
Fixtures and tooling
Testing
Not included: the T310's comfort temperature/humidity settings ( 🤖 Generated with Claude Code
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsAdd smart modules for components found on KE100/KE110 thermostats and T310/T315 sensors that were not yet supported: - ThermostatSchedule (smart_control_schedule): read and toggle the schedule and its mode via get/set_sc_schedule_info, fetch the paginated schedules via get_sc_schedule_rules and replace a day's slots via edit_sc_schedule_rule, with validation that the slots cover the whole day. Devices only accept edits to the active mode's schedules, so set_schedule() rejects ids from other modes. - TemperatureCorrection (temperature_correction): use another sensor on the same hub as the thermostat's temperature source. - TemperatureRecords (temp_record): the thermostat's 24h temperature history in 15 minute steps. - TemperatureHumidityRecords (temp_humidity_record): the sensor's 24h temperature and humidity history. Hub children do not iterate list pages, so the schedule module pages through get_sc_schedule_rules itself, keeping schedule_mode on each request. dump_devinfo now queries the new components. Co-Authored-By: Claude Opus 5.5 <[email protected]> get_temperature_correction returns temp_sensor_device_id, the device id of the thermostat itself or of another hub child used as its temperature source. dump_devinfo now maps it to the scrubbed child id, keeping the link between the thermostat and its sensor, and it is redacted in logs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Dumped from devices paired to a KH100(UK) hub, including the responses for the schedule, temperature correction and temperature record components. The schedule tests now check against whatever schedules a fixture provides rather than assuming the default test data. Co-Authored-By: Claude Opus 5.5 <[email protected]> SmartChildDevice._update replaced _last_update with the response for the modules queried in that cycle, so modules that were not due lost their data and raised "You need to call update()". This only showed once child modules had different update intervals: the record modules refresh every 15 minutes while others refresh daily. Merge the response instead, as SmartDevice already does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Fixes mypy attr-defined errors for list_return_size and info. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## master #1806 +/- ## ========================================== + Coverage 93.43% 93.56% +0.13% ========================================== Files 160 164 +4 Lines 10095 10305 +210 Branches 1042 1062 +20 ========================================== + Hits 9432 9642 +210 Misses 471 471 Partials 192 192 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Brings the new modules to full line and branch coverage. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Hi @o-gent and thanks for the PR! Could you please split this up into several PRs to make it easier to review? One for the fixture, and one for every new module supported would be the best! If you want and it is needed to test the implementation, feel free to include the fixture in the first PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
hey @rytilahti, will do when i can ! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @rytilahti - split this into 6 PRs. One PR is still marked as draft as it depends on a couple of the other PRs. Hopefully, each PR is now well scoped for review! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Great, thank you @o-gent! I reviewed and merged already a couple of them, I think we can close this one now and continue getting those changes in in their respective PRs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.