Fix connection problems in the Broadlink integration#34670
Merged
MartinHjelmare merged 13 commits intohome-assistant:devfrom May 13, 2020
Merged
Fix connection problems in the Broadlink integration#34670MartinHjelmare merged 13 commits intohome-assistant:devfrom
MartinHjelmare merged 13 commits intohome-assistant:devfrom
Conversation
|
Hey there @Danielhiversen, mind taking a look at this pull request as its been labeled with a integration ( |
felipediel
commented
Apr 25, 2020
Contributor
Author
felipediel
left a comment
There was a problem hiding this comment.
@Danielhiversen How about we clean the airstrip for the next upgrade?
3 tasks
Member
|
Broadlink library 0.14.0 is now released |
felipediel
commented
May 10, 2020
felipediel
commented
May 11, 2020
20 tasks
Contributor
Author
|
@Danielhiversen All ready. Is there any chance of merging this update this week so I can proceed with the config entries? @MartinHjelmare @springstan Your reviews would be appreciated. |
MartinHjelmare
requested changes
May 13, 2020
Member
|
The changes look very good, in general! |
MartinHjelmare
approved these changes
May 13, 2020
This was referenced May 16, 2020
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Some users are experiencing connection problems with Broadlink devices. The root of these problems is that we are ignoring the error codes that are being sent by the device in its responses.
Let's take a practical example. We need authorization to send a command. If we send a command without being authorized we will receive an authorization error. It's simple to deal with it, we just need to re-authenticate and send the command again. But currently we are not handling this exception. So once the connection is closed for some reason, the user needs to restart Home Assistant to make the device work again.
Here is a real case. Once @AndroVet's device closes the connection, the device object breaks silently because it doesn't know it has been logged out.
Proposed change
I updated the library to propagate errors in the response as exceptions. Now we just need to deal with these exceptions in Home Assistant. These are the changes I propose:
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.The integration reached or maintains the following Integration Quality Scale: