diff --git a/homeassistant/components/alexa/handlers.py b/homeassistant/components/alexa/handlers.py index f67e2e259d0..77e3c7f7d38 100644 --- a/homeassistant/components/alexa/handlers.py +++ b/homeassistant/components/alexa/handlers.py @@ -1137,7 +1137,7 @@ async def async_api_set_range(hass, config, directive, context): service = cover.SERVICE_OPEN_COVER_TILT else: service = cover.SERVICE_SET_COVER_TILT_POSITION - data[cover.ATTR_POSITION] = range_value + data[cover.ATTR_TILT_POSITION] = range_value # Input Number Value elif instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}": diff --git a/tests/components/alexa/test_smart_home.py b/tests/components/alexa/test_smart_home.py index 1510474aa6e..3d1e2b58d89 100644 --- a/tests/components/alexa/test_smart_home.py +++ b/tests/components/alexa/test_smart_home.py @@ -2774,10 +2774,10 @@ async def test_cover_tilt_position_range(hass): "cover#test_tilt_range", "cover.set_cover_tilt_position", hass, - payload={"rangeValue": "50"}, + payload={"rangeValue": 50}, instance="cover.tilt", ) - assert call.data["position"] == 50 + assert call.data["tilt_position"] == 50 call, msg = await assert_request_calls_service( "Alexa.RangeController", @@ -2785,7 +2785,7 @@ async def test_cover_tilt_position_range(hass): "cover#test_tilt_range", "cover.close_cover_tilt", hass, - payload={"rangeValue": "0"}, + payload={"rangeValue": 0}, instance="cover.tilt", ) properties = msg["context"]["properties"][0] @@ -2799,7 +2799,7 @@ async def test_cover_tilt_position_range(hass): "cover#test_tilt_range", "cover.open_cover_tilt", hass, - payload={"rangeValue": "100"}, + payload={"rangeValue": 100}, instance="cover.tilt", ) properties = msg["context"]["properties"][0] @@ -2813,7 +2813,7 @@ async def test_cover_tilt_position_range(hass): "cover#test_tilt_range", "cover.open_cover_tilt", hass, - payload={"rangeValueDelta": "99"}, + payload={"rangeValueDelta": 99}, instance="cover.tilt", ) properties = msg["context"]["properties"][0] @@ -2827,7 +2827,7 @@ async def test_cover_tilt_position_range(hass): "cover#test_tilt_range", "cover.close_cover_tilt", hass, - payload={"rangeValueDelta": "-99"}, + payload={"rangeValueDelta": -99}, instance="cover.tilt", ) properties = msg["context"]["properties"][0]