-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add weheat core integration #123057
Add weheat core integration #123057
Conversation
…a-core into feature/weheat_integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jesperraemaekers,@kjell-van-straaten
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
…a-core into feature/weheat_integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jesperraemaekers,@kjell-van-straaten
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Now you almost sound like a frontender :P |
And even if the refresh of the token is short, it shouldn't cause a reauth. I think a possible solution could be that they invalidate at the same time. The moment |
This is already long ways from the firmware i normally work on, trying to fit in :D I did see before that the session of the logged in user in keycloak is pretty short. |
I use the 'offline' scope for my rest api integration, that has never expired. Maybe you can use that for this oauth flow also? |
I did now, would you be so kind to see if it work better? |
Is there a way to see the JWT token? Then you can check the expiration date |
check |
Okay, new update has no expiration, the previous one had 30 days. Which makes sense given you provided the keys a month ago :) Old key: "expires_in": 300,
"refresh_expires_in": 2522164,
"scope": "api.access.odata profile email",
"expires_at": 1725529324.5112088 New key: "expires_in": 300,
"refresh_expires_in": 0,
"scope": "openid api.access.odata profile offline_access email",
"expires_at": 1725531907.6238155 Few notes:
|
The weheat library is 90% just generated code from a API specification. the generator just does not happen to use aiohttp for the API client. |
We checked and found out that the access_token lifetime was set to 1 minute for the HomeAssistantAPI client id, which does not help the authentication at all. This is now corrected. |
LOL |
Send you a message on discord |
Oh and nice seeing @barryvdh here. I used quite some laravel stuff you made back in the days :) |
* Add empty weheat integration * Add first sensor to weheat integration * Add weheat entity to provide device information * Fixed automatic selection for a single heat pump * Replaced integration specific package and removed status sensor * Update const.py * Add reauthentication support for weheat integration * Add test cases for the config flow of the weheat integration * Changed API and OATH url to weheat production environment * Add empty weheat integration * Add first sensor to weheat integration * Add weheat entity to provide device information * Fixed automatic selection for a single heat pump * Replaced integration specific package and removed status sensor * Add reauthentication support for weheat integration * Update const.py * Add test cases for the config flow of the weheat integration * Changed API and OATH url to weheat production environment * Resolved merge conflict after adding weheat package * Apply suggestions from code review Co-authored-by: Joost Lekkerkerker <[email protected]> * Added translation keys, more type info and version bump the weheat package * Adding native property value for weheat sensor * Removed reauth, added weheat sensor description and changed discovery of heat pumps * Added unique ID of user to entity * Replaced string by constants, added test case for duplicate unique id * Removed duplicate constant * Added offline scope * Removed re-auth related code * Simplified oath implementation * Cleanup tests for weheat integration * Added oath scope to tests --------- Co-authored-by: kjell-van-straaten <[email protected]> Co-authored-by: Joost Lekkerkerker <[email protected]>
Breaking change
Proposed change
This will integrate the heat pumps of Weheat. We've started implementing only 3 temperature sensors to keep the PR size small (as small as it can be for a new integration). More sensors and a controllable interface will follow.
Some notes on the checklist below:
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: