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

Alexa thermostat fails to properly parse 'value' field for climate (#13958)

* Fix thermostat payload issue

* fix test payload

* style issue

* handle both string and value object
This commit is contained in:
Michael Wei
2018-04-18 11:19:05 -07:00
committed by Paulus Schoutsen
parent c5cb28d41f
commit 0eb3e49880
2 changed files with 11 additions and 2 deletions

View File

@@ -1471,6 +1471,7 @@ async def async_api_adjust_target_temp(hass, config, request, entity):
async def async_api_set_thermostat_mode(hass, config, request, entity):
"""Process a set thermostat mode request."""
mode = request[API_PAYLOAD]['thermostatMode']
mode = mode if isinstance(mode, str) else mode['value']
operation_list = entity.attributes.get(climate.ATTR_OPERATION_LIST)
# Work around a pylint false positive due to