Fix Livisi climate min/max temperature (#90712)

* Correctly set livisi climate min/max temp

* fix imports
pull/90718/head
Felix Rotthowe 2023-04-03 14:17:57 +02:00 committed by GitHub
parent 45038bac16
commit bacbe4aa58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -3,6 +3,8 @@ from __future__ import annotations
from typing import Any from typing import Any
from aiolivisi.const import CAPABILITY_CONFIG
from homeassistant.components.climate import ( from homeassistant.components.climate import (
ClimateEntity, ClimateEntity,
ClimateEntityFeature, ClimateEntityFeature,
@ -65,8 +67,6 @@ class LivisiClimate(LivisiEntity, ClimateEntity):
_attr_hvac_mode = HVACMode.HEAT _attr_hvac_mode = HVACMode.HEAT
_attr_temperature_unit = UnitOfTemperature.CELSIUS _attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE _attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
_attr_target_temperature_high = MAX_TEMPERATURE
_attr_target_temperature_low = MIN_TEMPERATURE
def __init__( def __init__(
self, self,
@ -83,6 +83,10 @@ class LivisiClimate(LivisiEntity, ClimateEntity):
self._temperature_capability = self.capabilities["RoomTemperature"] self._temperature_capability = self.capabilities["RoomTemperature"]
self._humidity_capability = self.capabilities["RoomHumidity"] 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: async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature.""" """Set new target temperature."""
response = await self.aio_livisi.async_vrcc_set_temperature( response = await self.aio_livisi.async_vrcc_set_temperature(