Skip to content

Commit

Permalink
Fix ozw dimming transition (home-assistant#38850)
Browse files Browse the repository at this point in the history
* Handle float from light component

* Test with float

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
  • Loading branch information
firstof9 and balloob authored Aug 14, 2020
1 parent 47d1920 commit 5c9f29c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/ozw/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def async_set_duration(self, **kwargs):

else:
# transition specified by user
new_value = max(0, min(7620, kwargs[ATTR_TRANSITION]))
new_value = int(max(0, min(7620, kwargs[ATTR_TRANSITION])))
if ozw_version < (1, 6, 1205):
transition = kwargs[ATTR_TRANSITION]
if transition <= 127:
Expand Down
2 changes: 1 addition & 1 deletion tests/components/ozw/test_light.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def test_light(hass, light_data, light_msg, light_rgb_msg, sent_messages):
assert state.state == "off"

# Test turn on without brightness
new_transition = 127
new_transition = 127.0
await hass.services.async_call(
"light",
"turn_on",
Expand Down

0 comments on commit 5c9f29c

Please sign in to comment.