mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Alexa fan preset_mode support (#50466)
* fan preset_modes * process preset mode updates from alexa correctly * add tests * codecov patch additional tests
This commit is contained in:
@@ -400,6 +400,48 @@ async def test_report_fan_speed_state(hass):
|
||||
properties.assert_equal("Alexa.RangeController", "rangeValue", 3)
|
||||
|
||||
|
||||
async def test_report_fan_preset_mode(hass):
|
||||
"""Test ModeController reports fan preset_mode correctly."""
|
||||
hass.states.async_set(
|
||||
"fan.preset_mode",
|
||||
"eco",
|
||||
{
|
||||
"friendly_name": "eco enabled fan",
|
||||
"supported_features": 8,
|
||||
"preset_mode": "eco",
|
||||
"preset_modes": ["eco", "smart", "whoosh"],
|
||||
},
|
||||
)
|
||||
properties = await reported_properties(hass, "fan.preset_mode")
|
||||
properties.assert_equal("Alexa.ModeController", "mode", "preset_mode.eco")
|
||||
|
||||
hass.states.async_set(
|
||||
"fan.preset_mode",
|
||||
"smart",
|
||||
{
|
||||
"friendly_name": "smart enabled fan",
|
||||
"supported_features": 8,
|
||||
"preset_mode": "smart",
|
||||
"preset_modes": ["eco", "smart", "whoosh"],
|
||||
},
|
||||
)
|
||||
properties = await reported_properties(hass, "fan.preset_mode")
|
||||
properties.assert_equal("Alexa.ModeController", "mode", "preset_mode.smart")
|
||||
|
||||
hass.states.async_set(
|
||||
"fan.preset_mode",
|
||||
"whoosh",
|
||||
{
|
||||
"friendly_name": "whoosh enabled fan",
|
||||
"supported_features": 8,
|
||||
"preset_mode": "whoosh",
|
||||
"preset_modes": ["eco", "smart", "whoosh"],
|
||||
},
|
||||
)
|
||||
properties = await reported_properties(hass, "fan.preset_mode")
|
||||
properties.assert_equal("Alexa.ModeController", "mode", "preset_mode.whoosh")
|
||||
|
||||
|
||||
async def test_report_fan_oscillating(hass):
|
||||
"""Test ToggleController reports fan oscillating correctly."""
|
||||
hass.states.async_set(
|
||||
|
||||
Reference in New Issue
Block a user