mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Treat thermostat unknown state like unavailable in alexa (#74220)
This commit is contained in:
parent
de700e7859
commit
7573dc34aa
@ -1046,6 +1046,8 @@ class AlexaThermostatController(AlexaCapability):
|
||||
|
||||
if preset in API_THERMOSTAT_PRESETS:
|
||||
mode = API_THERMOSTAT_PRESETS[preset]
|
||||
elif self.entity.state == STATE_UNKNOWN:
|
||||
return None
|
||||
else:
|
||||
mode = API_THERMOSTAT_MODES.get(self.entity.state)
|
||||
if mode is None:
|
||||
|
@ -658,13 +658,16 @@ async def test_report_climate_state(hass):
|
||||
"Alexa.TemperatureSensor", "temperature", {"value": 34.0, "scale": "CELSIUS"}
|
||||
)
|
||||
|
||||
hass.states.async_set(
|
||||
"climate.unavailable",
|
||||
"unavailable",
|
||||
{"friendly_name": "Climate Unavailable", "supported_features": 91},
|
||||
)
|
||||
properties = await reported_properties(hass, "climate.unavailable")
|
||||
properties.assert_not_has_property("Alexa.ThermostatController", "thermostatMode")
|
||||
for state in "unavailable", "unknown":
|
||||
hass.states.async_set(
|
||||
f"climate.{state}",
|
||||
state,
|
||||
{"friendly_name": f"Climate {state}", "supported_features": 91},
|
||||
)
|
||||
properties = await reported_properties(hass, f"climate.{state}")
|
||||
properties.assert_not_has_property(
|
||||
"Alexa.ThermostatController", "thermostatMode"
|
||||
)
|
||||
|
||||
hass.states.async_set(
|
||||
"climate.unsupported",
|
||||
|
Loading…
x
Reference in New Issue
Block a user