Update the API to resolve status issues and add support for lights#13
Update the API to resolve status issues and add support for lights#13frwickst merged 5 commits intofrwickst:mainfrom
Conversation
|
Thank you! This was actually partially my own oversight here. I asked the CTO of Huum to add some of these features and I just did not notice the target temp addition that he talked about in the email response 😄 Here are his responses from the questions that I had. So there might be a bit more that could be implemented here. The Home Assistant core staff wanted to have a sauna ID when I created the integration, but nothing like that existed at the time in the API (they did have this info internally). So let's see now, I will take a look at this, clean it up a bit, add some tests and maybe also add some of the other API endpoints if they exist already (unclear since I never tried them). 👇 My questions as quotes and responses in bold
This should be live, please let me know if there are any issues with this one.
We will add a new request GET /action/home/profile for this
We will add a new request GET /action/home/profile for this
We don’t have a functionality like this. So there is a possibility that the target temperature is displayed differently in app and the controller. But to save bandwith we also send the TT info only once we start the sauna. Hoping we can avoid adding this. PS. I asked these questions some time ago already (10 months), so all of these things might be live already. |
This is the same API that is used by the Android application that is used by Huum. It supports the same authentication method as before as well. Some of the response structure has changed with this update and the schemas are therefor changes. The main breaking change is the removal of `max_heating_time` in the reponse (a value that is now found in the `sauna_config`. Note that this minor breaking change should not impact integrations such as Home Assistant, as that value is not used there.
This is a major breaking change, and will break the Home Assistant integration if code is not updated there. The function is removed as the hack for getting the target temperature is no longer needed due to changes in the Huum API. The API now always returns the correct target temperature without needing to call the `off` endpoint.
|
@AgeManning I did something that I normally does not do here. I took your branch, split it up and fixed some things, and pushed over your commits. This has the implication now that your commit is lost. So, if you want to, feel free to re-commit everything or if you really want to, rewrite the author of those commits to yourself. This all depends on how eager you are to get your name of on the commits. When you feel things are in OK shape, tell me and I'll merge this. |
|
When this is merged, I'll make a new release for the library with a changelog of what has happened, and then I'll try to get an update pushed to Home Assistant as soon as I have the spare time. |
Note that this has not been tested by me (Frank) but by Age Manning (AgeManning), so a big thanks to him for this change!
|
Yeah cool. I don't care at all about my name or commit here. Let me know if you need further testing with lights or anything. It's a bit annoying to fork home assistant, so keen for a release :) |
|
I'm not all that familiar with home assistant, only started using it a few days ago. But it looks like the API returns bools for |
|
Yeah, the reason I did not do any other sensor than the I'll merge this one. I also upgraded the Python packages now as well, so I guess I can try to make that release. |
Hey, so I decompiled the Huum apk and found out they seemed to have stitched you up. The app is using an updated API.
I had a quick play with the new API and it returns the target temperature on the status call, so you don't need to turn the Sauna off anymore to get that field.
It also looks like they've added a few new fields.
While I was there, figured I add the Light endpoint. I've tested it a bit, seems to work, but I'll do some more testing.
I haven't written python in a while, so feel free to modify this PR.
I've also removed the old status_or_off() function, so this is a breaking change and will require a decent version bump.
Lastly, it's worth doing a small amount of testing on this. I haven't checked all edge cases etc, but I think this is a substantial improvement.
Cheers