diff --git a/homeassistant/components/nest/climate_sdm.py b/homeassistant/components/nest/climate_sdm.py index 8c863471a4c..cebbe67284a 100644 --- a/homeassistant/components/nest/climate_sdm.py +++ b/homeassistant/components/nest/climate_sdm.py @@ -304,7 +304,9 @@ class ThermostatEntity(ClimateEntity): high_temp = kwargs.get(ATTR_TARGET_TEMP_HIGH) temp = kwargs.get(ATTR_TEMPERATURE) if ThermostatTemperatureSetpointTrait.NAME not in self._device.traits: - return + raise HomeAssistantError( + f"Error setting {self.entity_id} temperature to {kwargs}: Unable to find setpoint trait." + ) trait = self._device.traits[ThermostatTemperatureSetpointTrait.NAME] try: if self.preset_mode == PRESET_ECO or hvac_mode == HVACMode.HEAT_COOL: diff --git a/tests/components/nest/test_climate_sdm.py b/tests/components/nest/test_climate_sdm.py index 94643c792c1..0c25669963b 100644 --- a/tests/components/nest/test_climate_sdm.py +++ b/tests/components/nest/test_climate_sdm.py @@ -1259,8 +1259,12 @@ async def test_thermostat_missing_temperature_trait( assert ATTR_FAN_MODE not in thermostat.attributes assert ATTR_FAN_MODES not in thermostat.attributes - await common.async_set_temperature(hass, temperature=24.0) + with pytest.raises(HomeAssistantError) as e_info: + await common.async_set_temperature(hass, temperature=24.0) await hass.async_block_till_done() + assert "temperature" in str(e_info) + assert "climate.my_thermostat" in str(e_info) + assert "24.0" in str(e_info) assert thermostat.attributes[ATTR_TEMPERATURE] is None