Repository navigation
feat: add thermostat temperature history - #174
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 get_heating_history to both API layers (async and sync), calling
/history/heating/<id> with start/end in ms since epoch, timeUnit and rate,
always with operation=AVG (the only value Hive accepts).
Adds Climate.get_temperature_history(device, start, end, time_unit, rate),
which returns [{"date": <int ms>, "temperature": <float>}, ...] sorted by
date, with int-cast dates (Hive returns them as strings). Returns [] in
file mode, on HiveApiError (Hive answers 404 for zones with no history,
including TRVs) and for malformed responses. camelCase alias
getTemperatureHistory included.
Verified live against a heating zone: 24 hourly rows over a day and 7 daily
rows over a week. TRV zones return 404 as noted in the issue.
Closes Pyhass#34
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 #174 +/- ##
======================================
Coverage ? 99.96%
======================================
Files ? 30
Lines ? 2672
Branches ? 313
======================================
Hits ? 2671
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 thermostat temperature history, requested in #34.
HiveApiAsync.get_heating_historyandHiveApi.get_heating_history(node_id, start, end, time_unit="HOURS", rate=1)call/history/heating/<id>withstart/endin milliseconds since the epoch.operationis fixed toAVG, the only value Hive accepts. Both layers are coded by hand since unasync does not cover the API modules.Climate.get_temperature_history(device, start, end, time_unit="HOURS", rate=1)returns[{"date": <int ms>, "temperature": <float>}, ...]sorted by date. Hive returns dates as strings; they are cast to int. Returns[]in file mode, onHiveApiError, and for malformed responses, so callers never see an exception for a zone without history.getTemperatureHistoryonHeatingCompatMixin.Home Assistant impact
Additive only. Nothing in the HA
hiveintegration calls these methods;climate.pyondevusesgetClimate,setMode,setTargetTemperatureandsetBoostOn/Offonly. No existing method, return shape ordevice.statuskey changes.Testing
heatingzone: 24 hourly rows over the last day and 7 daily rows over the last week, values matching the Hive app's graph. Both the product ID and itsboilermoduleparent ID work; thethermostatuiand hub IDs return 404.trvcontrolzones return 404 ({"error": "NOT_FOUND"}), which the getter turns into[]with a warning. Hot water history was not tried; I have a combi boiler.Note: running against the live service today also needs #169, since the Hive SSO login page changed on 2026-10-20.
Closes #34
🤖 Generated with Claude Code