-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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 ozw dimming transition #38850
Fix ozw dimming transition #38850
Conversation
Unrelated check failed |
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.
might be worth hardening the test transition value type to catch future changes from sending float.
https://github.com/home-assistant/core/blob/dev/tests/components/ozw/test_light.py#L34
>>> x = {'a': 0.0}
>>> y = {'a': 0}
>>> assert x == y # false positive
>>> assert isinstance(x['a'], int)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AssertionError
Previous version of ozw values get converted to int already. I just forgot to int the fix for the new transition time. |
got it, actually added the assert I thought we were missing and you are right... tests still pass so that wont catch it. The instance version is less than the conditional so dropping into the if block that has the int |
Change the light test to send a float as the transition instead of an integer. The sent value should still be an integer. |
* Handle float from light component * Test with float Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Handle float from light component * Test with float Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Proposed change
The light component sends the transition as a float, we instead need a int.
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: