Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions homeassistant/components/sensibo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload Sensibo config entry."""
if await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
del hass.data[DOMAIN][entry.entry_id]
if not hass.data[DOMAIN]:
del hass.data[DOMAIN]
return True
return False
return unload_ok


async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
Expand Down
6 changes: 4 additions & 2 deletions homeassistant/components/sensibo/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ async def async_set_temperature(self, **kwargs) -> None:
)

if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
return
raise ValueError("No target temperature provided")

if temperature == self.target_temperature:
return
Expand All @@ -192,7 +192,9 @@ async def async_set_temperature(self, **kwargs) -> None:
temperature = self.device_data.temp_list[0]

else:
return
raise ValueError(
f"Target temperature has to be one off {str(self.device_data.temp_list)}"
)

await self._async_set_ac_state_property("targetTemperature", int(temperature))

Expand Down