Fix on/off button in the Broadlink integration#42443
Merged
elupus merged 1 commit intohome-assistant:devfrom Oct 30, 2020
Merged
Fix on/off button in the Broadlink integration#42443elupus merged 1 commit intohome-assistant:devfrom
elupus merged 1 commit intohome-assistant:devfrom
Conversation
|
Hey there @Danielhiversen, mind taking a look at this pull request as its been labeled with an integration ( |
elupus
approved these changes
Oct 28, 2020
Contributor
elupus
left a comment
There was a problem hiding this comment.
Hah! That explains how I ended up in that state.
dgomes
approved these changes
Oct 30, 2020
Contributor
Author
|
Thaank you! I will add an assumed_state option soon. |
Thomas55555
pushed a commit
to Thomas55555/core
that referenced
this pull request
Feb 24, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Users are being tricked. Their universal remotes suddenly stop working because we are turning off the button accidentally.
The cause
When the last state is "unavailable" the state is being casted to "off" in async_added_to_hass().
Proposed change
I think we should consider the entity "off" only if the last state is "off". Any other state should be casted to "on". So we don't take the risk of deactivating the remote when the last state is "unavailable".
But now if the user turns the entity off and restarts Home Assistant when the remote is unavailable, the entity will be initialized as "on". Something that seems much less harmful, after all we usually want the entity on. But not perfect yet.
Something I won't touch here, but I leave it as a suggestion: I think that availability should not be mixed with the state. It is difficult to persist the user's choice in this way.
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:
To help with the load of incoming pull requests: