Use EntityFeature enum in components (z**) (#69471)
* Use EntityFeature enum in zha * Use EntityFeature enum in zhong_hong * Use EntityFeature enum in ziggo_mediabox_xl * Use EntityFeature enum in zwave_js * Use EntityFeature enum in zwave_me
This commit is contained in:
parent
aaf64f728e
commit
fbea950eb0
10 changed files with 76 additions and 121 deletions
|
@ -3,11 +3,8 @@ from __future__ import annotations
|
|||
|
||||
from zwave_me_ws import ZWaveMeData
|
||||
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate.const import (
|
||||
HVAC_MODE_HEAT,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
)
|
||||
from homeassistant.components.climate import ClimateEntity, ClimateEntityFeature
|
||||
from homeassistant.components.climate.const import HVAC_MODE_HEAT
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import ATTR_TEMPERATURE
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -51,6 +48,8 @@ async def async_setup_entry(
|
|||
class ZWaveMeClimate(ZWaveMeEntity, ClimateEntity):
|
||||
"""Representation of a ZWaveMe sensor."""
|
||||
|
||||
_attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
|
||||
def set_temperature(self, **kwargs) -> None:
|
||||
"""Set new target temperature."""
|
||||
if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None:
|
||||
|
@ -90,11 +89,6 @@ class ZWaveMeClimate(ZWaveMeEntity, ClimateEntity):
|
|||
"""Return the current mode."""
|
||||
return HVAC_MODE_HEAT
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Return the supported features."""
|
||||
return SUPPORT_TARGET_TEMPERATURE
|
||||
|
||||
@property
|
||||
def target_temperature_step(self) -> float:
|
||||
"""Return the supported step of target temperature."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue