Adds new climate feature flags to melissa (#109469)

This commit is contained in:
G Johansson 2024-02-03 01:05:33 -05:00 committed by GitHub
parent eb7d125976
commit 82a2980cbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View file

@ -57,9 +57,13 @@ class MelissaClimate(ClimateEntity):
_attr_hvac_modes = OP_MODES
_attr_supported_features = (
ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.TARGET_TEMPERATURE
ClimateEntityFeature.FAN_MODE
| ClimateEntityFeature.TARGET_TEMPERATURE
| ClimateEntityFeature.TURN_OFF
| ClimateEntityFeature.TURN_ON
)
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, api, serial_number, init_data):
"""Initialize the climate device."""

View file

@ -223,7 +223,10 @@ async def test_supported_features(hass: HomeAssistant) -> None:
device = (await api.async_fetch_devices())[_SERIAL]
thermostat = MelissaClimate(api, _SERIAL, device)
features = (
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE
ClimateEntityFeature.TARGET_TEMPERATURE
| ClimateEntityFeature.FAN_MODE
| ClimateEntityFeature.TURN_OFF
| ClimateEntityFeature.TURN_ON
)
assert thermostat.supported_features == features