-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Fix displayed units for BMW Connected Drive #76613
Fix displayed units for BMW Connected Drive #76613
Conversation
Hey there @gerard33, mind taking a look at this pull request as it has been labeled with an integration ( |
Could you add a test to verify the new behaviour especially showing metric/imperial units now working correctly? |
Adding "a test" was more effort as I had to setup a test base. However thanks for the hint, being able to test in HA surely makes sense! |
Just refactored the test to use a pytest fixture and streamlined it to use the same vehicle as #74871. Unfortunately this was quite a lot of code change in the tests again, but I hope I included everything you need and it will be much easier to write tests in the future. |
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.
Looks good!
Proposed change
Fixes the displayed sensor units (
_attr_native_unit_of_measurement
) depending on the HA unit system, which was broken due to #75225 (value conversion worked, but unit was wrong for imperial).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: