1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

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
11 changed files with 497 additions and 515 deletions

View File

@@ -3,7 +3,7 @@ import pytest
import voluptuous_serialize
import homeassistant.components.automation as automation
from homeassistant.components.climate import DOMAIN, const, device_condition
from homeassistant.components.climate import DOMAIN, HVACMode, const, device_condition
from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.helpers import config_validation as cv, device_registry
from homeassistant.helpers.entity import EntityCategory
@@ -207,7 +207,7 @@ async def test_if_state(hass, calls):
hass.states.async_set(
"climate.entity",
const.HVAC_MODE_COOL,
HVACMode.COOL,
{
const.ATTR_PRESET_MODE: const.PRESET_AWAY,
},
@@ -220,7 +220,7 @@ async def test_if_state(hass, calls):
hass.states.async_set(
"climate.entity",
const.HVAC_MODE_AUTO,
HVACMode.AUTO,
{
const.ATTR_PRESET_MODE: const.PRESET_AWAY,
},
@@ -239,7 +239,7 @@ async def test_if_state(hass, calls):
hass.states.async_set(
"climate.entity",
const.HVAC_MODE_AUTO,
HVACMode.AUTO,
{
const.ATTR_PRESET_MODE: const.PRESET_HOME,
},
@@ -256,7 +256,7 @@ async def test_if_state(hass, calls):
[
(
False,
{const.ATTR_HVAC_MODES: [const.HVAC_MODE_COOL, const.HVAC_MODE_OFF]},
{const.ATTR_HVAC_MODES: [HVACMode.COOL, HVACMode.OFF]},
{},
"is_hvac_mode",
[
@@ -285,7 +285,7 @@ async def test_if_state(hass, calls):
(
True,
{},
{const.ATTR_HVAC_MODES: [const.HVAC_MODE_COOL, const.HVAC_MODE_OFF]},
{const.ATTR_HVAC_MODES: [HVACMode.COOL, HVACMode.OFF]},
"is_hvac_mode",
[
{
@@ -339,7 +339,7 @@ async def test_capabilities(
if set_state:
hass.states.async_set(
f"{DOMAIN}.test_5678",
const.HVAC_MODE_COOL,
HVACMode.COOL,
capabilities_state,
)