-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
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
Change Honeywell somecomfort API to AIOSomecomfort API #86102
Conversation
Hey there @rdfurman, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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.
LGTM, I'd like a second opinion about the library change though
remove "todo" from code Co-authored-by: Erik Montnemery <erik@montnemery.com>
There's a lot "bad" about the old library :) This will be multi part for sure - next PR will be to add the reauth flow, and follow on PR's to address issues in the backlog. |
update devices per entity rework retry login
Thank the lord someone with some python experience came to rescue this integration haha! I was really flailing around here and was getting pretty demotivated to work on it. Awesome job moving the backing library (somecomfort) to AIO. For some reason I thought it would need a full rewrite but it looks like you were able to keep the majority of the old code and integrate AIO. I was struggling with trying to learn how to create a new python library project and get that all uploaded to pypi.org and everything. This is awesome news, hopefully everything will work better now that you've determined the root cause (login endpoint having a rate limit). I will message you outside of this PR to talk about some of the other major issues and goals I had with this integration modernization project. I see now I may have bitten off more than I can chew alone, but now that you're here perhaps we can get this thing working like a well oiled machine. Once again, great work and thanks for taking this on! |
@rdfurman : chat on discord is best. mkmer#0872 Glad to be of assistance - as usual, it's mostly a selfish activity, but why not share :) I've been looking at the backlog of issues - I think we can fix many of them up fairly quickly now that we have control of the API. |
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.
Please address the comments in a new PR. Thanks!
Does this mean that there's a local API in use for some of the requests and only some requests are going to the cloud? |
Unfortunately, there is not a local API. The original somecomfort requests based API was refreshing web pages and re-logging in multiple times - this was triggering an API rate limit from Honeywell. Only logging in when the session keys have been expired prevents hitting the API limit. Polling the device parameters with device.refresh() can be run as fast as 1 second, but the web page updates at 10 seconds (so I did the same). |
Polling a cloud API at 10 seconds sounds excessive even if we're not rate limited at the moment. I'd recommend using a longer update interval, eg 30 seconds, unless there is documentation that says that 10 seconds is allowed. |
I was thinking that was a bit fast... but that's what they are doing :) |
Proposed change
Move to AIOSomecomfort API - ported from https://github.com/kk7ds/somecomfort requests based API
Remove rate limit, updating at 10 seconds vs 5 minutes
Use HASS clientsession for aiohttp.
Type of change
Additional information
Checklist
black --fast 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
..coveragerc
.To help with the load of incoming pull requests: