Cleanup HVACAction and HVACMode in tests (#78813)

This commit is contained in:
epenet 2022-09-20 20:30:54 +02:00 committed by GitHub
parent 3cf26c4a5d
commit f453726b18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 497 additions and 515 deletions

View file

@ -7,10 +7,9 @@ import pytest
import voluptuous as vol
from homeassistant.components.climate import (
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
SET_TEMPERATURE_SCHEMA,
ClimateEntity,
HVACMode,
)
from tests.common import async_mock_service
@ -50,20 +49,20 @@ class MockClimateEntity(ClimateEntity):
"""Mock Climate device to use in tests."""
@property
def hvac_mode(self) -> str:
def hvac_mode(self) -> HVACMode:
"""Return hvac operation ie. heat, cool mode.
Need to be one of HVAC_MODE_*.
Need to be one of HVACMode.*.
"""
return HVAC_MODE_HEAT
return HVACMode.HEAT
@property
def hvac_modes(self) -> list[str]:
def hvac_modes(self) -> list[HVACMode]:
"""Return the list of available hvac operation modes.
Need to be a subset of HVAC_MODES.
"""
return [HVAC_MODE_OFF, HVAC_MODE_HEAT]
return [HVACMode.OFF, HVACMode.HEAT]
def turn_on(self) -> None:
"""Turn on."""