Repository navigation
feat: add get_schedule/set_schedule for heating and hot water - #173
Open
matt-thepie wants to merge 2 commits into
Open
matt-thepie wants to merge 2 commits into
matt-thepie wants to merge 2 commits into
Conversation
Adds ScheduleMixin (src/devices/schedule.py), composed into HiveHeating and HiveHotwater. get_schedule returns an editable copy of the weekly schedule; set_schedule validates and normalises the week, posts all seven days (Hive only accepts full-week updates), then re-reads the product and returns False if Hive silently ignored the change. camelCase aliases getSchedule/setSchedule are included for HA compatibility. Verified live on a trvcontrol zone: slot edit stored and restored correctly. Closes Pyhass#19 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #173 +/- ##
======================================
Coverage ? 99.96%
======================================
Files ? 31
Lines ? 2717
Branches ? 323
======================================
Hits ? 2716
Misses ? 0
Partials ? 1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This branch has not been deployed
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds schedule writing for heating and hot water, requested in #19.
ScheduleMixin(src/devices/schedule.py), composed intoHiveHeatingandHiveHotwater.get_schedule(device)returns an editable deep copy of the seven-day schedule.set_schedule(device, schedule)validates and normalises the week (drops extra keys the Hive web app adds, sorts slots, raisesValueErroron bad input), posts all seven days (Hive only accepts full-week updates), then re-reads the product and returnsFalseif Hive answered 200 but ignored the change.getSchedule/setScheduleinhelper/compat_aliases.py.examples/example_set_schedule.py, a round-trip example that edits one slot, verifies it, and restores the original.Home Assistant impact
Additive only. Nothing in the HA
hiveintegration calls these methods;climate.pyandwater_heater.pyondevusesetMode,setTargetTemperature,setBoostOn/Offonly. No existing method, return shape ordevice.statuskey changes.Testing
trvcontrolzone: slot edit stored and restored correctly (set_schedulereturnedTrueboth times, re-read schedules matched).hotwaterproduct to test against. Someone with a Hive hot water zone could confirm with the example (swaphive.heatingforhive.hotwater).Note: running the example against the live service today also needs #169, since the Hive SSO login page changed on 2026-10-20.
Closes #19
🤖 Generated with Claude Code