Fix precision of vicare target & current temperature (#66456)

This commit is contained in:
Hans Oischinger 2022-03-16 13:14:11 +01:00 committed by GitHub
parent f0dba8ec70
commit 2c8bf006eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 3 deletions

View File

@ -24,7 +24,12 @@ from homeassistant.components.climate.const import (
SUPPORT_TARGET_TEMPERATURE,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, TEMP_CELSIUS
from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_TENTHS,
PRECISION_WHOLE,
TEMP_CELSIUS,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_platform
import homeassistant.helpers.config_validation as cv
@ -310,6 +315,11 @@ class ViCareClimate(ClimateEntity):
@property
def precision(self):
"""Return the precision of the system."""
return PRECISION_TENTHS
@property
def target_temperature_step(self) -> float:
"""Set target temperature step to wholes."""
return PRECISION_WHOLE
def set_temperature(self, **kwargs):

View File

@ -14,7 +14,12 @@ from homeassistant.components.water_heater import (
WaterHeaterEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, TEMP_CELSIUS
from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_TENTHS,
PRECISION_WHOLE,
TEMP_CELSIUS,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@ -191,10 +196,15 @@ class ViCareWater(WaterHeaterEntity):
"""Return the maximum temperature."""
return VICARE_TEMP_WATER_MAX
@property
def target_temperature_step(self) -> float:
"""Set target temperature step to wholes."""
return PRECISION_WHOLE
@property
def precision(self):
"""Return the precision of the system."""
return PRECISION_WHOLE
return PRECISION_TENTHS
@property
def current_operation(self):