1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Improved Alexa ThermostatController thermostatMode handling (#28176)

* Update ThermostatController to map directives to supported modes and add support for CUSTOM mode.

* Removed erroneous config value from test.

* Removed unnecessary use of a comprehension by dumbing down comment so pylint could comprehend.

* Removed erroneous import variable caused by removing erroneous config value from test.

* Removed unnecessary use of a comprehension.

* Reverted Removal or erroneous import variable and erroneous config value from test.
Apparently need for additional tests outside this component. Whoops.
This commit is contained in:
ochlocracy
2019-10-25 16:42:21 -04:00
committed by Paulus Schoutsen
parent f4341c1546
commit d44bfa8e88
5 changed files with 105 additions and 11 deletions

View File

@@ -472,11 +472,7 @@ async def test_report_climate_state(hass):
{"value": 34.0, "scale": "CELSIUS"},
)
for off_modes in (
climate.HVAC_MODE_OFF,
climate.HVAC_MODE_FAN_ONLY,
climate.HVAC_MODE_DRY,
):
for off_modes in (climate.HVAC_MODE_OFF, climate.HVAC_MODE_FAN_ONLY):
hass.states.async_set(
"climate.downstairs",
off_modes,
@@ -495,6 +491,23 @@ async def test_report_climate_state(hass):
{"value": 34.0, "scale": "CELSIUS"},
)
# assert dry is reported as CUSTOM
hass.states.async_set(
"climate.downstairs",
"dry",
{
"friendly_name": "Climate Downstairs",
"supported_features": 91,
climate.ATTR_CURRENT_TEMPERATURE: 34,
ATTR_UNIT_OF_MEASUREMENT: TEMP_CELSIUS,
},
)
properties = await reported_properties(hass, "climate.downstairs")
properties.assert_equal("Alexa.ThermostatController", "thermostatMode", "CUSTOM")
properties.assert_equal(
"Alexa.TemperatureSensor", "temperature", {"value": 34.0, "scale": "CELSIUS"}
)
hass.states.async_set(
"climate.heat",
"heat",