Skip to content

Commit

Permalink
Fix Livisi climate min/max temperature (#90712)
Browse files Browse the repository at this point in the history
* Correctly set livisi climate min/max temp

* fix imports
  • Loading branch information
planbnet committed Apr 3, 2023
1 parent 45038ba commit bacbe4a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions homeassistant/components/livisi/climate.py
Expand Up @@ -3,6 +3,8 @@

from typing import Any

from aiolivisi.const import CAPABILITY_CONFIG

from homeassistant.components.climate import (
ClimateEntity,
ClimateEntityFeature,
Expand Down Expand Up @@ -65,8 +67,6 @@ class LivisiClimate(LivisiEntity, ClimateEntity):
_attr_hvac_mode = HVACMode.HEAT
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
_attr_target_temperature_high = MAX_TEMPERATURE
_attr_target_temperature_low = MIN_TEMPERATURE

def __init__(
self,
Expand All @@ -83,6 +83,10 @@ def __init__(
self._temperature_capability = self.capabilities["RoomTemperature"]
self._humidity_capability = self.capabilities["RoomHumidity"]

config = device.get(CAPABILITY_CONFIG, {}).get("RoomSetpoint", {})
self._attr_max_temp = config.get("maxTemperature", MAX_TEMPERATURE)
self._attr_min_temp = config.get("minTemperature", MIN_TEMPERATURE)

async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
response = await self.aio_livisi.async_vrcc_set_temperature(
Expand Down

0 comments on commit bacbe4a

Please sign in to comment.