Add PowerLevelController for fan to alexa (#27158)

* Implement AlexaPowerLevelController

* Implement AlexaPowerLevelController Tests
This commit is contained in:
ochlocracy authored and Paulus Schoutsen committed 2019-10-03 13:28:02 -07:00
1 parent 565302ed34
commit af81878d08
5 files changed
+135 -1

No files matched your search

+22
View File
@@ -340,6 +340,7 @@ async def test_variable_fan(hass):
appliance,
"Alexa.PercentageController",
"Alexa.PowerController",
"Alexa.PowerLevelController",
"Alexa.EndpointHealth",
)
@@ -364,6 +365,27 @@ async def test_variable_fan(hass):
"speed",
)
call, _ = await assert_request_calls_service(
"Alexa.PowerLevelController",
"SetPowerLevel",
"fan#test_2",
"fan.set_speed",
hass,
payload={"powerLevel": "50"},
)
assert call.data["speed"] == "medium"
await assert_percentage_changes(
hass,
[("high", "-5"), ("high", "5"), ("low", "-80")],
"Alexa.PowerLevelController",
"AdjustPowerLevel",
"fan#test_2",
"powerLevelDelta",
"fan.set_speed",
"speed",
)
async def test_lock(hass):
"""Test lock discovery."""