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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use value_fn for bmw_connected_drive binary_sensor #57540
Use value_fn for bmw_connected_drive binary_sensor #57540
Conversation
Hey there @gerard33, @rikroe, mind taking a look at this pull request as it has been labeled with an 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.
While the diff looks very confusing I like the end result.
Unfortunately, cannot test this on my car, but at least no errors/warning are raised (i.e. it still ignores sensors your car doesn't have).
Thanks!
@gerard33 Would you be able to test this change, too? |
Sure will also test this change. |
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.
All binary sensors work fine for my car with combustion engine (so can't test the EV binary sensors 馃槈).
04bccc4
to
360e3bb
Compare
Please rebase on top of the current dev branch. |
360e3bb
to
ba1a6c7
Compare
馃憤馃徎 Did the rebase. As it has been tested already, I would argue this PR is almost done and could be merged as is. |
ba1a6c7
to
c85e301
Compare
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, Thanks @cdce8p 馃憤
Proposed change
Refactor
bmw_connected_drive
binary_sensor
to usevalue_fn
as attribute on theEntityDescription
. By doing so we can remove almost all logic from theupdate
method itself.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: