Use EntityFeature enum in components (m**) (#69414)
* Use EntityFeature in melcloud * Use EntityFeature in mystrom * Use EntityFeature in mysensors * Use EntityFeature in myq * Use EntityFeature in mpd * Use EntityFeature in monoprice * Use EntityFeature in moehlenhoff_alpha2 * Use EntityFeature in modern_forms * Use EntityFeature in modbus * Use EntityFeature in melissa * Use EntityFeature in mediaroom * Use EntityFeature in maxcube * Use EntityFeature in manual_mqtt * Fix maxcube tests * Revert "Use EntityFeature in modbus" This reverts commit56cf9d900d
. * Revert "Use EntityFeature in myq" This reverts commit44a31b1a03
. * Revert "Use EntityFeature in mystrom" This reverts commit7260ee0384
. * Revert "Revert "Use EntityFeature in modbus"" This reverts commit916a612a60
. * Revert "Revert "Use EntityFeature in myq"" This reverts commita6be42fa17
.
This commit is contained in:
parent
8e090a8c04
commit
5e2cc2b9b0
15 changed files with 109 additions and 160 deletions
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateEntity
|
||||
from homeassistant.components.climate import ClimateEntity, ClimateEntityFeature
|
||||
from homeassistant.components.climate.const import (
|
||||
FAN_AUTO,
|
||||
FAN_HIGH,
|
||||
|
@ -15,8 +15,6 @@ from homeassistant.components.climate.const import (
|
|||
HVAC_MODE_FAN_ONLY,
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_OFF,
|
||||
SUPPORT_FAN_MODE,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
)
|
||||
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, TEMP_CELSIUS
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
@ -27,8 +25,6 @@ from . import DATA_MELISSA
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SUPPORT_FLAGS = SUPPORT_FAN_MODE | SUPPORT_TARGET_TEMPERATURE
|
||||
|
||||
OP_MODES = [
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_COOL,
|
||||
|
@ -62,6 +58,10 @@ async def async_setup_platform(
|
|||
class MelissaClimate(ClimateEntity):
|
||||
"""Representation of a Melissa Climate device."""
|
||||
|
||||
_attr_supported_features = (
|
||||
ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.TARGET_TEMPERATURE
|
||||
)
|
||||
|
||||
def __init__(self, api, serial_number, init_data):
|
||||
"""Initialize the climate device."""
|
||||
self._name = init_data["name"]
|
||||
|
@ -147,11 +147,6 @@ class MelissaClimate(ClimateEntity):
|
|||
"""Return the maximum supported temperature for the thermostat."""
|
||||
return 30
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Return the list of supported features."""
|
||||
return SUPPORT_FLAGS
|
||||
|
||||
async def async_set_temperature(self, **kwargs):
|
||||
"""Set new target temperature."""
|
||||
temp = kwargs.get(ATTR_TEMPERATURE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue