Use climate enums in zwave_me (#70756)

This commit is contained in:
epenet 2022-04-26 09:30:54 +02:00 committed by GitHub
parent a7bb74e151
commit d2c31de4ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,8 +3,8 @@ from __future__ import annotations
from zwave_me_ws import ZWaveMeData
from homeassistant.components.climate import ClimateEntity, ClimateEntityFeature
from homeassistant.components.climate.const import HVAC_MODE_HEAT
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import ClimateEntityFeature, HVACMode
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE
from homeassistant.core import HomeAssistant, callback
@ -48,6 +48,8 @@ async def async_setup_entry(
class ZWaveMeClimate(ZWaveMeEntity, ClimateEntity):
"""Representation of a ZWaveMe sensor."""
_attr_hvac_mode = HVACMode.HEAT
_attr_hvac_modes = [HVACMode.HEAT]
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
def set_temperature(self, **kwargs) -> None:
@ -79,16 +81,6 @@ class ZWaveMeClimate(ZWaveMeEntity, ClimateEntity):
"""Return max temperature for the device."""
return self.device.min
@property
def hvac_modes(self) -> list[str]:
"""Return the list of available operation modes."""
return [HVAC_MODE_HEAT]
@property
def hvac_mode(self) -> str:
"""Return the current mode."""
return HVAC_MODE_HEAT
@property
def target_temperature_step(self) -> float:
"""Return the supported step of target temperature."""