Cleanup EntityFeature in tests (#78859)

This commit is contained in:
epenet 2022-09-21 10:48:55 +02:00 committed by GitHub
parent c88a874063
commit 0ac581a0b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 472 additions and 472 deletions

View file

@ -3,11 +3,7 @@ Regression tests for Aqara Gateway V3.
https://github.com/home-assistant/core/issues/20957
"""
from homeassistant.components.alarm_control_panel import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
)
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntityFeature
from homeassistant.components.number import NumberMode
from homeassistant.helpers.entity import EntityCategory
@ -42,9 +38,9 @@ async def test_aqara_gateway_setup(hass):
"alarm_control_panel.aqara_hub_1563_security_system",
friendly_name="Aqara Hub-1563 Security System",
unique_id="homekit-0000000123456789-66304",
supported_features=SUPPORT_ALARM_ARM_NIGHT
| SUPPORT_ALARM_ARM_HOME
| SUPPORT_ALARM_ARM_AWAY,
supported_features=AlarmControlPanelEntityFeature.ARM_NIGHT
| AlarmControlPanelEntityFeature.ARM_HOME
| AlarmControlPanelEntityFeature.ARM_AWAY,
state="disarmed",
),
EntityTestInfo(
@ -101,9 +97,9 @@ async def test_aqara_gateway_e1_setup(hass):
"alarm_control_panel.aqara_hub_e1_00a0_security_system",
friendly_name="Aqara-Hub-E1-00A0 Security System",
unique_id="homekit-00aa00000a0-16",
supported_features=SUPPORT_ALARM_ARM_NIGHT
| SUPPORT_ALARM_ARM_HOME
| SUPPORT_ALARM_ARM_AWAY,
supported_features=AlarmControlPanelEntityFeature.ARM_NIGHT
| AlarmControlPanelEntityFeature.ARM_HOME
| AlarmControlPanelEntityFeature.ARM_AWAY,
state="disarmed",
),
EntityTestInfo(

View file

@ -1,6 +1,6 @@
"""Make sure that a H.A.A. fan can be setup."""
from homeassistant.components.fan import ATTR_PERCENTAGE, SUPPORT_SET_SPEED
from homeassistant.components.fan import ATTR_PERCENTAGE, FanEntityFeature
from homeassistant.helpers.entity import EntityCategory
from ..common import (
@ -58,7 +58,7 @@ async def test_haa_fan_setup(hass):
friendly_name="HAA-C718B3",
unique_id="homekit-C718B3-1-8",
state="on",
supported_features=SUPPORT_SET_SPEED,
supported_features=FanEntityFeature.SET_SPEED,
capabilities={
"preset_modes": None,
},

View file

@ -1,10 +1,6 @@
"""Test against characteristics captured from the Home Assistant HomeKit bridge running demo platforms."""
from homeassistant.components.fan import (
SUPPORT_DIRECTION,
SUPPORT_OSCILLATE,
SUPPORT_SET_SPEED,
)
from homeassistant.components.fan import FanEntityFeature
from ..common import (
HUB_TEST_ACCESSORY_ID,
@ -49,9 +45,9 @@ async def test_homeassistant_bridge_fan_setup(hass):
friendly_name="Living Room Fan",
unique_id="homekit-fan.living_room_fan-8",
supported_features=(
SUPPORT_DIRECTION
| SUPPORT_SET_SPEED
| SUPPORT_OSCILLATE
FanEntityFeature.DIRECTION
| FanEntityFeature.SET_SPEED
| FanEntityFeature.OSCILLATE
),
capabilities={
"preset_modes": None,

View file

@ -1,6 +1,6 @@
"""Make sure that Mysa Living is enumerated properly."""
from homeassistant.components.climate import SUPPORT_TARGET_TEMPERATURE
from homeassistant.components.climate import ClimateEntityFeature
from homeassistant.components.sensor import SensorStateClass
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
@ -35,7 +35,7 @@ async def test_mysa_living_setup(hass):
entity_id="climate.mysa_85dda9_thermostat",
friendly_name="Mysa-85dda9 Thermostat",
unique_id="homekit-AAAAAAA000-20",
supported_features=SUPPORT_TARGET_TEMPERATURE,
supported_features=ClimateEntityFeature.TARGET_TEMPERATURE,
capabilities={
"hvac_modes": ["off", "heat", "cool", "heat_cool"],
"max_temp": 35,

View file

@ -1,10 +1,6 @@
"""Test against characteristics captured from a ryse smart bridge platforms."""
from homeassistant.components.cover import (
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
)
from homeassistant.components.cover import CoverEntityFeature
from homeassistant.components.sensor import SensorStateClass
from homeassistant.const import PERCENTAGE
@ -17,7 +13,9 @@ from ..common import (
setup_test_accessories,
)
RYSE_SUPPORTED_FEATURES = SUPPORT_CLOSE | SUPPORT_SET_POSITION | SUPPORT_OPEN
RYSE_SUPPORTED_FEATURES = (
CoverEntityFeature.CLOSE | CoverEntityFeature.SET_POSITION | CoverEntityFeature.OPEN
)
async def test_ryse_smart_bridge_setup(hass):

View file

@ -4,7 +4,7 @@ Test against characteristics captured from a SIMPLEconnect Fan.
https://github.com/home-assistant/core/issues/26180
"""
from homeassistant.components.fan import SUPPORT_DIRECTION, SUPPORT_SET_SPEED
from homeassistant.components.fan import FanEntityFeature
from ..common import (
HUB_TEST_ACCESSORY_ID,
@ -37,7 +37,8 @@ async def test_simpleconnect_fan_setup(hass):
entity_id="fan.simpleconnect_fan_06f674_hunter_fan",
friendly_name="SIMPLEconnect Fan-06F674 Hunter Fan",
unique_id="homekit-1234567890abcd-8",
supported_features=SUPPORT_DIRECTION | SUPPORT_SET_SPEED,
supported_features=FanEntityFeature.DIRECTION
| FanEntityFeature.SET_SPEED,
capabilities={
"preset_modes": None,
},

View file

@ -4,11 +4,7 @@ Test against characteristics captured from a Velux Gateway.
https://github.com/home-assistant/core/issues/44314
"""
from homeassistant.components.cover import (
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
)
from homeassistant.components.cover import CoverEntityFeature
from homeassistant.components.sensor import SensorStateClass
from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
@ -56,9 +52,9 @@ async def test_velux_cover_setup(hass):
entity_id="cover.velux_window_roof_window",
friendly_name="VELUX Window Roof Window",
unique_id="homekit-1111111a114a111a-8",
supported_features=SUPPORT_CLOSE
| SUPPORT_SET_POSITION
| SUPPORT_OPEN,
supported_features=CoverEntityFeature.CLOSE
| CoverEntityFeature.SET_POSITION
| CoverEntityFeature.OPEN,
state="closed",
),
],

View file

@ -1,6 +1,6 @@
"""Make sure that Vocolinc Flowerbud is enumerated properly."""
from homeassistant.components.humidifier import SUPPORT_MODES
from homeassistant.components.humidifier import HumidifierEntityFeature
from homeassistant.components.number import NumberMode
from homeassistant.components.sensor import SensorStateClass
from homeassistant.const import PERCENTAGE
@ -37,7 +37,7 @@ async def test_vocolinc_flowerbud_setup(hass):
entity_id="humidifier.vocolinc_flowerbud_0d324b",
friendly_name="VOCOlinc-Flowerbud-0d324b",
unique_id="homekit-AM01121849000327-30",
supported_features=SUPPORT_MODES,
supported_features=HumidifierEntityFeature.MODES,
capabilities={
"available_modes": ["normal", "auto"],
"max_humidity": 100.0,