diff --git a/homeassistant/components/sensibo/climate.py b/homeassistant/components/sensibo/climate.py index 390ebc080b8..c2f03c2d568 100644 --- a/homeassistant/components/sensibo/climate.py +++ b/homeassistant/components/sensibo/climate.py @@ -22,7 +22,7 @@ from homeassistant.const import ( UnitOfTemperature, ) from homeassistant.core import HomeAssistant -from homeassistant.exceptions import HomeAssistantError, ServiceValidationError +from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers import config_validation as cv, entity_platform from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.util.unit_conversion import TemperatureConverter @@ -108,7 +108,7 @@ AC_STATE_TO_DATA = { } -def _find_valid_target_temp(target: int, valid_targets: list[int]) -> int: +def _find_valid_target_temp(target: float, valid_targets: list[int]) -> int: if target <= valid_targets[0]: return valid_targets[0] if target >= valid_targets[-1]: @@ -320,12 +320,7 @@ class SensiboClimate(SensiboDeviceBaseEntity, ClimateEntity): translation_key="no_target_temperature_in_features", ) - if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None: - raise ServiceValidationError( - translation_domain=DOMAIN, - translation_key="no_target_temperature", - ) - + temperature: float = kwargs[ATTR_TEMPERATURE] if temperature == self.target_temperature: return diff --git a/homeassistant/components/sensibo/strings.json b/homeassistant/components/sensibo/strings.json index bec402bee18..302e34bb5aa 100644 --- a/homeassistant/components/sensibo/strings.json +++ b/homeassistant/components/sensibo/strings.json @@ -500,9 +500,6 @@ "no_target_temperature_in_features": { "message": "Current mode doesn't support setting target temperature" }, - "no_target_temperature": { - "message": "No target temperature provided" - }, "no_fan_level_in_features": { "message": "Current mode doesn't support setting fan level" }, diff --git a/tests/components/sensibo/test_climate.py b/tests/components/sensibo/test_climate.py index 8be9f4a60e4..7916727e57a 100644 --- a/tests/components/sensibo/test_climate.py +++ b/tests/components/sensibo/test_climate.py @@ -347,6 +347,17 @@ async def test_climate_temperatures( state2 = hass.states.get("climate.hallway") assert state2.attributes["temperature"] == 20 + with patch( + "homeassistant.components.sensibo.coordinator.SensiboClient.async_set_ac_state_property", + ) as mock_call: + await hass.services.async_call( + CLIMATE_DOMAIN, + SERVICE_SET_TEMPERATURE, + {ATTR_ENTITY_ID: state1.entity_id, ATTR_TEMPERATURE: 20}, + blocking=True, + ) + assert not mock_call.called + with ( patch( "homeassistant.components.sensibo.coordinator.SensiboClient.async_get_devices_data",