mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 23:07:09 +00:00
Drop useless unit conversion in smarttub (#145287)
This commit is contained in:
parent
cd91aca3b5
commit
ed2024e67a
@ -18,7 +18,6 @@ from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
from homeassistant.util.unit_conversion import TemperatureConverter
|
||||
|
||||
from .const import DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP
|
||||
from .controller import SmartTubConfigEntry
|
||||
@ -70,6 +69,8 @@ class SmartTubThermostat(SmartTubEntity, ClimateEntity):
|
||||
ClimateEntityFeature.PRESET_MODE | ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
)
|
||||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_min_temp = DEFAULT_MIN_TEMP
|
||||
_attr_max_temp = DEFAULT_MAX_TEMP
|
||||
_attr_preset_modes = list(PRESET_MODES.values())
|
||||
|
||||
def __init__(
|
||||
@ -93,23 +94,7 @@ class SmartTubThermostat(SmartTubEntity, ClimateEntity):
|
||||
raise NotImplementedError(hvac_mode)
|
||||
|
||||
@property
|
||||
def min_temp(self):
|
||||
"""Return the minimum temperature."""
|
||||
min_temp = DEFAULT_MIN_TEMP
|
||||
return TemperatureConverter.convert(
|
||||
min_temp, UnitOfTemperature.CELSIUS, self.temperature_unit
|
||||
)
|
||||
|
||||
@property
|
||||
def max_temp(self):
|
||||
"""Return the maximum temperature."""
|
||||
max_temp = DEFAULT_MAX_TEMP
|
||||
return TemperatureConverter.convert(
|
||||
max_temp, UnitOfTemperature.CELSIUS, self.temperature_unit
|
||||
)
|
||||
|
||||
@property
|
||||
def preset_mode(self):
|
||||
def preset_mode(self) -> str:
|
||||
"""Return the current preset mode."""
|
||||
return PRESET_MODES[self.spa_status.heat_mode]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user