Fix attribute in Alexa service call for cover tilt (#31223)
* Update attribute in Alexa service call for cover tilt * Update Tests to fix Tilt Position call. Co-authored-by: ochlocracy <5885236+ochlocracy@users.noreply.github.com>
This commit is contained in:
parent
1f7ab9091b
commit
ed970797be
2 changed files with 7 additions and 7 deletions
|
@ -1137,7 +1137,7 @@ async def async_api_set_range(hass, config, directive, context):
|
||||||
service = cover.SERVICE_OPEN_COVER_TILT
|
service = cover.SERVICE_OPEN_COVER_TILT
|
||||||
else:
|
else:
|
||||||
service = cover.SERVICE_SET_COVER_TILT_POSITION
|
service = cover.SERVICE_SET_COVER_TILT_POSITION
|
||||||
data[cover.ATTR_POSITION] = range_value
|
data[cover.ATTR_TILT_POSITION] = range_value
|
||||||
|
|
||||||
# Input Number Value
|
# Input Number Value
|
||||||
elif instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
|
elif instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
|
||||||
|
|
|
@ -2774,10 +2774,10 @@ async def test_cover_tilt_position_range(hass):
|
||||||
"cover#test_tilt_range",
|
"cover#test_tilt_range",
|
||||||
"cover.set_cover_tilt_position",
|
"cover.set_cover_tilt_position",
|
||||||
hass,
|
hass,
|
||||||
payload={"rangeValue": "50"},
|
payload={"rangeValue": 50},
|
||||||
instance="cover.tilt",
|
instance="cover.tilt",
|
||||||
)
|
)
|
||||||
assert call.data["position"] == 50
|
assert call.data["tilt_position"] == 50
|
||||||
|
|
||||||
call, msg = await assert_request_calls_service(
|
call, msg = await assert_request_calls_service(
|
||||||
"Alexa.RangeController",
|
"Alexa.RangeController",
|
||||||
|
@ -2785,7 +2785,7 @@ async def test_cover_tilt_position_range(hass):
|
||||||
"cover#test_tilt_range",
|
"cover#test_tilt_range",
|
||||||
"cover.close_cover_tilt",
|
"cover.close_cover_tilt",
|
||||||
hass,
|
hass,
|
||||||
payload={"rangeValue": "0"},
|
payload={"rangeValue": 0},
|
||||||
instance="cover.tilt",
|
instance="cover.tilt",
|
||||||
)
|
)
|
||||||
properties = msg["context"]["properties"][0]
|
properties = msg["context"]["properties"][0]
|
||||||
|
@ -2799,7 +2799,7 @@ async def test_cover_tilt_position_range(hass):
|
||||||
"cover#test_tilt_range",
|
"cover#test_tilt_range",
|
||||||
"cover.open_cover_tilt",
|
"cover.open_cover_tilt",
|
||||||
hass,
|
hass,
|
||||||
payload={"rangeValue": "100"},
|
payload={"rangeValue": 100},
|
||||||
instance="cover.tilt",
|
instance="cover.tilt",
|
||||||
)
|
)
|
||||||
properties = msg["context"]["properties"][0]
|
properties = msg["context"]["properties"][0]
|
||||||
|
@ -2813,7 +2813,7 @@ async def test_cover_tilt_position_range(hass):
|
||||||
"cover#test_tilt_range",
|
"cover#test_tilt_range",
|
||||||
"cover.open_cover_tilt",
|
"cover.open_cover_tilt",
|
||||||
hass,
|
hass,
|
||||||
payload={"rangeValueDelta": "99"},
|
payload={"rangeValueDelta": 99},
|
||||||
instance="cover.tilt",
|
instance="cover.tilt",
|
||||||
)
|
)
|
||||||
properties = msg["context"]["properties"][0]
|
properties = msg["context"]["properties"][0]
|
||||||
|
@ -2827,7 +2827,7 @@ async def test_cover_tilt_position_range(hass):
|
||||||
"cover#test_tilt_range",
|
"cover#test_tilt_range",
|
||||||
"cover.close_cover_tilt",
|
"cover.close_cover_tilt",
|
||||||
hass,
|
hass,
|
||||||
payload={"rangeValueDelta": "-99"},
|
payload={"rangeValueDelta": -99},
|
||||||
instance="cover.tilt",
|
instance="cover.tilt",
|
||||||
)
|
)
|
||||||
properties = msg["context"]["properties"][0]
|
properties = msg["context"]["properties"][0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue