From 5c9f29c43ac0b37ac070634e955ba34f8316ab7f Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 14 Aug 2020 05:35:42 -0700 Subject: [PATCH] Fix ozw dimming transition (#38850) * Handle float from light component * Test with float Co-authored-by: Paulus Schoutsen --- homeassistant/components/ozw/light.py | 2 +- tests/components/ozw/test_light.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/ozw/light.py b/homeassistant/components/ozw/light.py index 2c7461976c4613..7464023868d772 100644 --- a/homeassistant/components/ozw/light.py +++ b/homeassistant/components/ozw/light.py @@ -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: diff --git a/tests/components/ozw/test_light.py b/tests/components/ozw/test_light.py index 8f9892e37cd52e..e35a7214858193 100644 --- a/tests/components/ozw/test_light.py +++ b/tests/components/ozw/test_light.py @@ -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",