Add alias to DOMAIN import in tests [h-m] (#125577)

* Add alias to DOMAIN import in tests [h-m]

* Revert changes to mqtt
This commit is contained in:
epenet
2024-09-09 15:21:01 +02:00
committed by GitHub
parent aab939cf6c
commit 6ea59ffa94
17 changed files with 189 additions and 155 deletions

View File

@@ -13,7 +13,7 @@ from aiohomekit.model.characteristics import (
from aiohomekit.model.services import ServicesTypes
from homeassistant.components.climate import (
DOMAIN,
DOMAIN as CLIMATE_DOMAIN,
SERVICE_SET_FAN_MODE,
SERVICE_SET_HUMIDITY,
SERVICE_SET_HVAC_MODE,
@@ -113,7 +113,7 @@ async def test_climate_change_thermostat_state(
helper = await setup_test_component(hass, get_next_aid(), create_thermostat_service)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
@@ -126,7 +126,7 @@ async def test_climate_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.COOL},
blocking=True,
@@ -139,7 +139,7 @@ async def test_climate_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT_COOL},
blocking=True,
@@ -152,7 +152,7 @@ async def test_climate_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.OFF},
blocking=True,
@@ -165,7 +165,7 @@ async def test_climate_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_FAN_MODE,
{"entity_id": "climate.testdevice", "fan_mode": "on"},
blocking=True,
@@ -178,7 +178,7 @@ async def test_climate_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_FAN_MODE,
{"entity_id": "climate.testdevice", "fan_mode": "auto"},
blocking=True,
@@ -198,7 +198,7 @@ async def test_climate_check_min_max_values_per_mode(
helper = await setup_test_component(hass, get_next_aid(), create_thermostat_service)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
@@ -208,7 +208,7 @@ async def test_climate_check_min_max_values_per_mode(
assert climate_state.attributes["max_temp"] == 35
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.COOL},
blocking=True,
@@ -218,7 +218,7 @@ async def test_climate_check_min_max_values_per_mode(
assert climate_state.attributes["max_temp"] == 35
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT_COOL},
blocking=True,
@@ -235,7 +235,7 @@ async def test_climate_change_thermostat_temperature(
helper = await setup_test_component(hass, get_next_aid(), create_thermostat_service)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{"entity_id": "climate.testdevice", "temperature": 21},
blocking=True,
@@ -248,7 +248,7 @@ async def test_climate_change_thermostat_temperature(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{"entity_id": "climate.testdevice", "temperature": 25},
blocking=True,
@@ -268,14 +268,14 @@ async def test_climate_change_thermostat_temperature_range(
helper = await setup_test_component(hass, get_next_aid(), create_thermostat_service)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT_COOL},
blocking=True,
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{
"entity_id": "climate.testdevice",
@@ -303,14 +303,14 @@ async def test_climate_change_thermostat_temperature_range_iphone(
helper = await setup_test_component(hass, get_next_aid(), create_thermostat_service)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT_COOL},
blocking=True,
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{
"entity_id": "climate.testdevice",
@@ -338,14 +338,14 @@ async def test_climate_cannot_set_thermostat_temp_range_in_wrong_mode(
helper = await setup_test_component(hass, get_next_aid(), create_thermostat_service)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{
"entity_id": "climate.testdevice",
@@ -399,7 +399,7 @@ async def test_climate_check_min_max_values_per_mode_sspa_device(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
@@ -409,7 +409,7 @@ async def test_climate_check_min_max_values_per_mode_sspa_device(
assert climate_state.attributes["max_temp"] == 35
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.COOL},
blocking=True,
@@ -419,7 +419,7 @@ async def test_climate_check_min_max_values_per_mode_sspa_device(
assert climate_state.attributes["max_temp"] == 35
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT_COOL},
blocking=True,
@@ -438,14 +438,14 @@ async def test_climate_set_thermostat_temp_on_sspa_device(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{"entity_id": "climate.testdevice", "temperature": 21},
blocking=True,
@@ -458,7 +458,7 @@ async def test_climate_set_thermostat_temp_on_sspa_device(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT_COOL},
blocking=True,
@@ -471,7 +471,7 @@ async def test_climate_set_thermostat_temp_on_sspa_device(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{
"entity_id": "climate.testdevice",
@@ -496,7 +496,7 @@ async def test_climate_set_mode_via_temp(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{
"entity_id": "climate.testdevice",
@@ -514,7 +514,7 @@ async def test_climate_set_mode_via_temp(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{
"entity_id": "climate.testdevice",
@@ -539,7 +539,7 @@ async def test_climate_change_thermostat_humidity(
helper = await setup_test_component(hass, get_next_aid(), create_thermostat_service)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HUMIDITY,
{"entity_id": "climate.testdevice", "humidity": 50},
blocking=True,
@@ -552,7 +552,7 @@ async def test_climate_change_thermostat_humidity(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HUMIDITY,
{"entity_id": "climate.testdevice", "humidity": 45},
blocking=True,
@@ -768,7 +768,7 @@ async def test_heater_cooler_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
@@ -781,7 +781,7 @@ async def test_heater_cooler_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.COOL},
blocking=True,
@@ -794,7 +794,7 @@ async def test_heater_cooler_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT_COOL},
blocking=True,
@@ -807,7 +807,7 @@ async def test_heater_cooler_change_thermostat_state(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.OFF},
blocking=True,
@@ -832,7 +832,7 @@ async def test_can_turn_on_after_off(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.OFF},
blocking=True,
@@ -845,7 +845,7 @@ async def test_can_turn_on_after_off(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
@@ -868,13 +868,13 @@ async def test_heater_cooler_change_thermostat_temperature(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.HEAT},
blocking=True,
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{"entity_id": "climate.testdevice", "temperature": 20},
blocking=True,
@@ -887,13 +887,13 @@ async def test_heater_cooler_change_thermostat_temperature(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.COOL},
blocking=True,
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{"entity_id": "climate.testdevice", "temperature": 26},
blocking=True,
@@ -915,13 +915,13 @@ async def test_heater_cooler_change_fan_speed(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{"entity_id": "climate.testdevice", "hvac_mode": HVACMode.COOL},
blocking=True,
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_FAN_MODE,
{"entity_id": "climate.testdevice", "fan_mode": "low"},
blocking=True,
@@ -933,7 +933,7 @@ async def test_heater_cooler_change_fan_speed(
},
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_FAN_MODE,
{"entity_id": "climate.testdevice", "fan_mode": "medium"},
blocking=True,
@@ -945,7 +945,7 @@ async def test_heater_cooler_change_fan_speed(
},
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_FAN_MODE,
{"entity_id": "climate.testdevice", "fan_mode": "high"},
blocking=True,
@@ -1121,7 +1121,7 @@ async def test_heater_cooler_change_swing_mode(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_SWING_MODE,
{"entity_id": "climate.testdevice", "swing_mode": "vertical"},
blocking=True,
@@ -1134,7 +1134,7 @@ async def test_heater_cooler_change_swing_mode(
)
await hass.services.async_call(
DOMAIN,
CLIMATE_DOMAIN,
SERVICE_SET_SWING_MODE,
{"entity_id": "climate.testdevice", "swing_mode": "off"},
blocking=True,