Skip to content
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

fix: Update tests for hass built-in unit conversions in 2022.11 #363

Merged
merged 3 commits into from
Nov 21, 2022

Conversation

carleeno
Copy link
Contributor

Updating homeassistant brought about failures in existing tests due to hass automatically converting units in sensors from miles to km (and speed equivalents).

There doesn't seem to be a way to globally disable unit conversion for tests, so this PR fixes failing tests by converting the mock values if necessary. This feels like a hack, so I'm open to suggestions. I alternatively tried setting hass.config.units to imperial, but that breaks the temperature tests since it converts the mock Celsius temps into Fahrenheit, so a conversion of the mock values would be needed regardless.

@alandtse
Copy link
Owner

alandtse commented Nov 20, 2022

I wonder if we need to update the ha custom component helper....

https://github.com/MatthewFlamm/pytest-homeassistant-custom-component

@alandtse alandtse merged commit 00eeaa5 into alandtse:dev Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants