-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
Upgrade aionanoleaf to 0.2.1 #83669
Upgrade aionanoleaf to 0.2.1 #83669
Conversation
57e3751
to
30b9606
Compare
you could have done that change easier instead of re-assigning except Exception as e:
if attempt < 3:
continue |
Also, you're reraising the exception ? You can use |
And also, you're not checking the status code of the client error, so you don't know if it's unavailable because the internet is down (connection error), the nanoleaf server is down (connection error or maybe timeout) or the auth is wrong. I would actually not wrap those errors in |
Can we get some movement on this? @balloob your comments make sense but the existing behavior around error handling hasn't really changed other than retrying a few times. Can we assume that this change will be no worse than 0.2.0 and save the updates to the error handling in this case for later? My home assistant nanoleaf integration is basically worthless at the moment because HA is saying its almost always unavailable. |
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.
I think the library change looks ok, although Paulus' suggestions are good to consider for the future.
@@ -3,7 +3,7 @@ | |||
"name": "Nanoleaf", | |||
"config_flow": true, | |||
"documentation": "https://www.home-assistant.io/integrations/nanoleaf", | |||
"requirements": ["aionanoleaf==0.2.0"], | |||
"requirements": ["aionanoleaf==0.2.1"], |
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.
Note that the retries are hardcoded to 3 instead of using the available parameter.
I'll address the comments in a future update. Sorry, I couldn't find time to look at this sooner. |
Proposed change
Some Nanoleaf devices have connectivity issues. The library will now retry several times to connect before throwing the Unavailable exception.
https://github.com/milanmeu/aionanoleaf/releases/tag/v0.2.1
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: