Open martintoreilly opened 2 years ago
I'm also happy to extend the Hive Home Assistant Integration to expose this new functionality, though I'll need some time to get my head into the codebase.
@martintoreilly as a starter for 10 I would build the api and then we can see how to can be utilised elsewhere. The key with this library is to make sure it’s compatible with 4 use cases
1) through home assistant 2) using a pyhiveapi as home assistant does but without home assistant 3) async raw api 4) sync raw api
with regards to unasync this only works on the main code not the api code so you do have to code twice as unasync doesn’t work well with sync and async http libraries
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
I would like to access my thermostat's temperature history. This is available from the following Hive beekeeper API endpoint :
https://beekeeper-uk.hivehome.com/1.0/history/heating/<thermostat_id>
with the following parameters.start
: Timestamp as milliseconds since unix epochend
: Timestamp as milliseconds since unix epochtimeUnit
:YEARS
,DAYS
,HOURS
,MINUTES
orSECONDS
.rate
: Integer valueoperation
: I can only find one valid valueAVG
, which is the default if this parameter is omittedI'm happy to make this change and submit a PR. @KJonline Do you have any thoughts about where this best fits in the
pyhiveapi
API structure?Additional context
404 - Not found
error, but I think it may be more nuanced than that. I was able to query with some start dates prior to the earliest returned date and setting the end date in the future did not give an error. I also had some dates intermittently give me the 404 error (25, 26, 27 Dec 2020). I can't be sure I was querying with single day resolution when I got those intermittent 404 errors, however I think the 404 error may occur if the query has had to look at more than about a year's worth of data. Perhaps there is some kind of internal timeout that gets translated as "no results" rather than a server error?