mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Remove unnecessary DOMAIN alias in tests (s-z) (#146010)
This commit is contained in:
parent
43ac550ca0
commit
de4a5fa30b
@ -15,7 +15,7 @@ from homeassistant.components.number import NumberDeviceClass
|
||||
from homeassistant.components.sensor import (
|
||||
DEVICE_CLASS_STATE_CLASSES,
|
||||
DEVICE_CLASS_UNITS,
|
||||
DOMAIN as SENSOR_DOMAIN,
|
||||
DOMAIN,
|
||||
NON_NUMERIC_DEVICE_CLASSES,
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
@ -2752,7 +2752,7 @@ async def test_name(hass: HomeAssistant) -> None:
|
||||
|
||||
mock_platform(
|
||||
hass,
|
||||
f"{TEST_DOMAIN}.{SENSOR_DOMAIN}",
|
||||
f"{TEST_DOMAIN}.{DOMAIN}",
|
||||
MockPlatform(async_setup_entry=async_setup_entry_platform),
|
||||
)
|
||||
|
||||
|
@ -6,10 +6,7 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
import pytest
|
||||
from solarlog_cli.solarlog_models import InverterData, SolarlogData
|
||||
|
||||
from homeassistant.components.solarlog.const import (
|
||||
CONF_HAS_PWD,
|
||||
DOMAIN as SOLARLOG_DOMAIN,
|
||||
)
|
||||
from homeassistant.components.solarlog.const import CONF_HAS_PWD, DOMAIN
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD
|
||||
|
||||
from .const import HOST
|
||||
@ -34,7 +31,7 @@ INVERTER_DATA = {
|
||||
def mock_config_entry() -> MockConfigEntry:
|
||||
"""Mock a config entry."""
|
||||
return MockConfigEntry(
|
||||
domain=SOLARLOG_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
title="solarlog",
|
||||
data={
|
||||
CONF_HOST: HOST,
|
||||
@ -51,7 +48,7 @@ def mock_solarlog_connector():
|
||||
"""Build a fixture for the SolarLog API that connects successfully and returns one device."""
|
||||
|
||||
data = SolarlogData.from_dict(
|
||||
load_json_object_fixture("solarlog_data.json", SOLARLOG_DOMAIN)
|
||||
load_json_object_fixture("solarlog_data.json", DOMAIN)
|
||||
)
|
||||
data.inverter_data = INVERTER_DATA
|
||||
|
||||
|
@ -27,7 +27,7 @@ from homeassistant.components.media_player import (
|
||||
RepeatMode,
|
||||
)
|
||||
from homeassistant.components.sonos.const import (
|
||||
DOMAIN as SONOS_DOMAIN,
|
||||
DOMAIN,
|
||||
MEDIA_TYPE_DIRECTORY,
|
||||
SOURCE_LINEIN,
|
||||
SOURCE_TV,
|
||||
@ -1012,7 +1012,7 @@ async def test_play_media_favorite_item_id(
|
||||
async def _setup_hass(hass: HomeAssistant):
|
||||
await async_setup_component(
|
||||
hass,
|
||||
SONOS_DOMAIN,
|
||||
DOMAIN,
|
||||
{
|
||||
"sonos": {
|
||||
"media_player": {
|
||||
@ -1037,7 +1037,7 @@ async def test_service_snapshot_restore(
|
||||
"homeassistant.components.sonos.speaker.Snapshot.snapshot"
|
||||
) as mock_snapshot:
|
||||
await hass.services.async_call(
|
||||
SONOS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SNAPSHOT,
|
||||
{
|
||||
ATTR_ENTITY_ID: ["media_player.living_room", "media_player.bedroom"],
|
||||
@ -1050,7 +1050,7 @@ async def test_service_snapshot_restore(
|
||||
"homeassistant.components.sonos.speaker.Snapshot.restore"
|
||||
) as mock_restore:
|
||||
await hass.services.async_call(
|
||||
SONOS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RESTORE,
|
||||
{
|
||||
ATTR_ENTITY_ID: ["media_player.living_room", "media_player.bedroom"],
|
||||
@ -1227,7 +1227,7 @@ async def test_media_get_queue(
|
||||
"""Test getting the media queue."""
|
||||
soco_mock = soco_factory.mock_list.get("192.168.42.2")
|
||||
result = await hass.services.async_call(
|
||||
SONOS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_GET_QUEUE,
|
||||
{
|
||||
ATTR_ENTITY_ID: "media_player.zone_a",
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.statistics import DOMAIN as STATISTICS_DOMAIN
|
||||
from homeassistant.components.statistics import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||
@ -51,7 +51,7 @@ async def test_device_cleaning(
|
||||
# Configure the configuration entry for Statistics
|
||||
statistics_config_entry = MockConfigEntry(
|
||||
data={},
|
||||
domain=STATISTICS_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
options={
|
||||
"name": "Statistics",
|
||||
"entity_id": "sensor.test_source",
|
||||
|
@ -20,7 +20,7 @@ from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorStateClass,
|
||||
)
|
||||
from homeassistant.components.statistics import DOMAIN as STATISTICS_DOMAIN
|
||||
from homeassistant.components.statistics import DOMAIN
|
||||
from homeassistant.components.statistics.sensor import (
|
||||
CONF_KEEP_LAST_SAMPLE,
|
||||
CONF_PERCENTILE,
|
||||
@ -78,7 +78,7 @@ async def test_unique_id(
|
||||
await hass.async_block_till_done()
|
||||
|
||||
entity_id = entity_registry.async_get_entity_id(
|
||||
"sensor", STATISTICS_DOMAIN, "uniqueid_sensor_test"
|
||||
"sensor", DOMAIN, "uniqueid_sensor_test"
|
||||
)
|
||||
assert entity_id == "sensor.test"
|
||||
|
||||
@ -1652,7 +1652,7 @@ async def test_reload(recorder_mock: Recorder, hass: HomeAssistant) -> None:
|
||||
yaml_path = get_fixture_path("configuration.yaml", "statistics")
|
||||
with patch.object(hass_config, "YAML_CONFIG_FILE", yaml_path):
|
||||
await hass.services.async_call(
|
||||
STATISTICS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RELOAD,
|
||||
{},
|
||||
blocking=True,
|
||||
@ -1690,7 +1690,7 @@ async def test_device_id(
|
||||
|
||||
statistics_config_entry = MockConfigEntry(
|
||||
data={},
|
||||
domain=STATISTICS_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
options={
|
||||
"name": "Statistics",
|
||||
"entity_id": "sensor.test_source",
|
||||
|
@ -8,7 +8,7 @@ from voluptuous.error import MultipleInvalid
|
||||
from homeassistant.components.lock import DOMAIN as LOCK_DOMAIN
|
||||
from homeassistant.components.subaru.const import (
|
||||
ATTR_DOOR,
|
||||
DOMAIN as SUBARU_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_UNLOCK_SPECIFIC_DOOR,
|
||||
UNLOCK_DOOR_DRIVERS,
|
||||
)
|
||||
@ -68,7 +68,7 @@ async def test_unlock_specific_door(hass: HomeAssistant, ev_entry) -> None:
|
||||
"""Test subaru unlock specific door function."""
|
||||
with patch(MOCK_API_UNLOCK) as mock_unlock:
|
||||
await hass.services.async_call(
|
||||
SUBARU_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_UNLOCK_SPECIFIC_DOOR,
|
||||
{ATTR_ENTITY_ID: DEVICE_ID, ATTR_DOOR: UNLOCK_DOOR_DRIVERS},
|
||||
blocking=True,
|
||||
@ -81,7 +81,7 @@ async def test_unlock_specific_door_invalid(hass: HomeAssistant, ev_entry) -> No
|
||||
"""Test subaru unlock specific door function."""
|
||||
with patch(MOCK_API_UNLOCK) as mock_unlock, pytest.raises(MultipleInvalid):
|
||||
await hass.services.async_call(
|
||||
SUBARU_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_UNLOCK_SPECIFIC_DOOR,
|
||||
{ATTR_ENTITY_ID: DEVICE_ID, ATTR_DOOR: "bad_value"},
|
||||
blocking=True,
|
||||
|
@ -8,7 +8,7 @@ import pytest
|
||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.components.subaru.sensor import (
|
||||
API_GEN_2_SENSORS,
|
||||
DOMAIN as SUBARU_DOMAIN,
|
||||
DOMAIN,
|
||||
EV_SENSORS,
|
||||
SAFETY_SENSORS,
|
||||
)
|
||||
@ -50,7 +50,7 @@ async def test_sensors_missing_vin_data(hass: HomeAssistant, ev_entry) -> None:
|
||||
(
|
||||
{
|
||||
"domain": SENSOR_DOMAIN,
|
||||
"platform": SUBARU_DOMAIN,
|
||||
"platform": DOMAIN,
|
||||
"unique_id": f"{TEST_VIN_2_EV}_Avg fuel consumption",
|
||||
},
|
||||
f"{TEST_VIN_2_EV}_Avg fuel consumption",
|
||||
@ -86,7 +86,7 @@ async def test_sensor_migrate_unique_ids(
|
||||
(
|
||||
{
|
||||
"domain": SENSOR_DOMAIN,
|
||||
"platform": SUBARU_DOMAIN,
|
||||
"platform": DOMAIN,
|
||||
"unique_id": f"{TEST_VIN_2_EV}_Avg fuel consumption",
|
||||
},
|
||||
f"{TEST_VIN_2_EV}_Avg fuel consumption",
|
||||
@ -112,7 +112,7 @@ async def test_sensor_migrate_unique_ids_duplicate(
|
||||
# create existing entry with new_unique_id that conflicts with migrate
|
||||
existing_entity = entity_registry.async_get_or_create(
|
||||
SENSOR_DOMAIN,
|
||||
SUBARU_DOMAIN,
|
||||
DOMAIN,
|
||||
unique_id=new_unique_id,
|
||||
config_entry=subaru_config_entry,
|
||||
)
|
||||
@ -138,7 +138,7 @@ def _assert_data(hass: HomeAssistant, expected_state: dict[str, Any]) -> None:
|
||||
entity_registry = er.async_get(hass)
|
||||
for item in sensor_list:
|
||||
entity = entity_registry.async_get_entity_id(
|
||||
SENSOR_DOMAIN, SUBARU_DOMAIN, f"{TEST_VIN_2_EV}_{item.key}"
|
||||
SENSOR_DOMAIN, DOMAIN, f"{TEST_VIN_2_EV}_{item.key}"
|
||||
)
|
||||
expected_states[entity] = expected_state[item.key]
|
||||
|
||||
|
@ -15,7 +15,7 @@ from homeassistant.components import media_source
|
||||
from homeassistant.components.tts import (
|
||||
CONF_LANG,
|
||||
DATA_TTS_MANAGER,
|
||||
DOMAIN as TTS_DOMAIN,
|
||||
DOMAIN,
|
||||
PLATFORM_SCHEMA as TTS_PLATFORM_SCHEMA,
|
||||
Provider,
|
||||
ResultStream,
|
||||
@ -212,11 +212,9 @@ async def mock_setup(
|
||||
) -> None:
|
||||
"""Set up a test provider."""
|
||||
mock_integration(hass, MockModule(domain=TEST_DOMAIN))
|
||||
mock_platform(hass, f"{TEST_DOMAIN}.{TTS_DOMAIN}", MockTTS(mock_provider))
|
||||
mock_platform(hass, f"{TEST_DOMAIN}.{DOMAIN}", MockTTS(mock_provider))
|
||||
|
||||
await async_setup_component(
|
||||
hass, TTS_DOMAIN, {TTS_DOMAIN: {"platform": TEST_DOMAIN}}
|
||||
)
|
||||
await async_setup_component(hass, DOMAIN, {DOMAIN: {"platform": TEST_DOMAIN}})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
|
||||
@ -261,7 +259,7 @@ async def mock_config_entry_setup(
|
||||
async_add_entities([tts_entity])
|
||||
|
||||
loaded_platform = MockPlatform(async_setup_entry=async_setup_entry_platform)
|
||||
mock_platform(hass, f"{test_domain}.{TTS_DOMAIN}", loaded_platform)
|
||||
mock_platform(hass, f"{test_domain}.{DOMAIN}", loaded_platform)
|
||||
|
||||
config_entry = MockConfigEntry(domain=test_domain)
|
||||
config_entry.add_to_hass(hass)
|
||||
|
@ -14,7 +14,7 @@ import orjson
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.unifi import STORAGE_KEY, STORAGE_VERSION
|
||||
from homeassistant.components.unifi.const import CONF_SITE_ID, DOMAIN as UNIFI_DOMAIN
|
||||
from homeassistant.components.unifi.const import CONF_SITE_ID, DOMAIN
|
||||
from homeassistant.components.unifi.hub.websocket import RETRY_TIMER
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
@ -112,7 +112,7 @@ def fixture_config_entry(
|
||||
) -> MockConfigEntry:
|
||||
"""Define a config entry fixture."""
|
||||
config_entry = MockConfigEntry(
|
||||
domain=UNIFI_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
entry_id="1",
|
||||
unique_id="1",
|
||||
data=config_entry_data,
|
||||
|
@ -21,7 +21,7 @@ from homeassistant.components.unifi.const import (
|
||||
CONF_TRACK_CLIENTS,
|
||||
CONF_TRACK_DEVICES,
|
||||
CONF_TRACK_WIRED_CLIENTS,
|
||||
DOMAIN as UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST,
|
||||
@ -100,7 +100,7 @@ async def test_flow_works(hass: HomeAssistant, mock_discovery) -> None:
|
||||
"""Test config flow."""
|
||||
mock_discovery.return_value = "1"
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
@ -139,7 +139,7 @@ async def test_flow_works(hass: HomeAssistant, mock_discovery) -> None:
|
||||
async def test_flow_works_negative_discovery(hass: HomeAssistant) -> None:
|
||||
"""Test config flow with a negative outcome of async_discovery_unifi."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
@ -166,7 +166,7 @@ async def test_flow_works_negative_discovery(hass: HomeAssistant) -> None:
|
||||
async def test_flow_multiple_sites(hass: HomeAssistant) -> None:
|
||||
"""Test config flow works when finding multiple sites."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
@ -193,7 +193,7 @@ async def test_flow_multiple_sites(hass: HomeAssistant) -> None:
|
||||
async def test_flow_raise_already_configured(hass: HomeAssistant) -> None:
|
||||
"""Test config flow aborts since a connected config entry already exists."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
@ -218,7 +218,7 @@ async def test_flow_raise_already_configured(hass: HomeAssistant) -> None:
|
||||
async def test_flow_aborts_configuration_updated(hass: HomeAssistant) -> None:
|
||||
"""Test config flow aborts since a connected config entry already exists."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
@ -247,7 +247,7 @@ async def test_flow_aborts_configuration_updated(hass: HomeAssistant) -> None:
|
||||
async def test_flow_fails_user_credentials_faulty(hass: HomeAssistant) -> None:
|
||||
"""Test config flow."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
@ -273,7 +273,7 @@ async def test_flow_fails_user_credentials_faulty(hass: HomeAssistant) -> None:
|
||||
async def test_flow_fails_hub_unavailable(hass: HomeAssistant) -> None:
|
||||
"""Test config flow."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
@ -480,7 +480,7 @@ async def test_simple_option_flow(
|
||||
async def test_form_ssdp(hass: HomeAssistant) -> None:
|
||||
"""Test we get the form with ssdp source."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_SSDP},
|
||||
data=SsdpServiceInfo(
|
||||
ssdp_usn="mock_usn",
|
||||
@ -520,7 +520,7 @@ async def test_form_ssdp(hass: HomeAssistant) -> None:
|
||||
async def test_form_ssdp_aborts_if_host_already_exists(hass: HomeAssistant) -> None:
|
||||
"""Test we abort if the host is already configured."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_SSDP},
|
||||
data=SsdpServiceInfo(
|
||||
ssdp_usn="mock_usn",
|
||||
@ -542,7 +542,7 @@ async def test_form_ssdp_aborts_if_serial_already_exists(hass: HomeAssistant) ->
|
||||
"""Test we abort if the serial is already configured."""
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_SSDP},
|
||||
data=SsdpServiceInfo(
|
||||
ssdp_usn="mock_usn",
|
||||
@ -562,13 +562,13 @@ async def test_form_ssdp_aborts_if_serial_already_exists(hass: HomeAssistant) ->
|
||||
async def test_form_ssdp_gets_form_with_ignored_entry(hass: HomeAssistant) -> None:
|
||||
"""Test we can still setup if there is an ignored never configured entry."""
|
||||
entry = MockConfigEntry(
|
||||
domain=UNIFI_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
data={"not_controller_key": None},
|
||||
source=config_entries.SOURCE_IGNORE,
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
context={"source": config_entries.SOURCE_SSDP},
|
||||
data=SsdpServiceInfo(
|
||||
ssdp_usn="mock_usn",
|
||||
|
@ -21,7 +21,7 @@ from homeassistant.components.unifi.const import (
|
||||
CONF_TRACK_DEVICES,
|
||||
CONF_TRACK_WIRED_CLIENTS,
|
||||
DEFAULT_DETECTION_TIME,
|
||||
DOMAIN as UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.const import STATE_HOME, STATE_NOT_HOME, STATE_UNAVAILABLE, Platform
|
||||
from homeassistant.core import HomeAssistant, State
|
||||
@ -588,14 +588,14 @@ async def test_restoring_client(
|
||||
"""Verify clients are restored from clients_all if they ever was registered to entity registry."""
|
||||
entity_registry.async_get_or_create( # Make sure unique ID converts to site_id-mac
|
||||
TRACKER_DOMAIN,
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
f"{clients_all_payload[0]['mac']}-site_id",
|
||||
suggested_object_id=clients_all_payload[0]["hostname"],
|
||||
config_entry=config_entry,
|
||||
)
|
||||
entity_registry.async_get_or_create( # Unique ID already follow format site_id-mac
|
||||
TRACKER_DOMAIN,
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
f"site_id-{client_payload[0]['mac']}",
|
||||
suggested_object_id=client_payload[0]["hostname"],
|
||||
config_entry=config_entry,
|
||||
|
@ -8,7 +8,7 @@ from unittest.mock import patch
|
||||
import aiounifi
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.unifi.const import DOMAIN as UNIFI_DOMAIN
|
||||
from homeassistant.components.unifi.const import DOMAIN
|
||||
from homeassistant.components.unifi.errors import AuthenticationRequired, CannotConnect
|
||||
from homeassistant.components.unifi.hub import get_unifi_api
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
@ -49,7 +49,7 @@ async def test_hub_setup(
|
||||
|
||||
device_entry = device_registry.async_get_or_create(
|
||||
config_entry_id=config_entry.entry_id,
|
||||
identifiers={(UNIFI_DOMAIN, config_entry.unique_id)},
|
||||
identifiers={(DOMAIN, config_entry.unique_id)},
|
||||
)
|
||||
|
||||
assert device_entry.sw_version == "7.4.162"
|
||||
|
@ -5,7 +5,7 @@ from unittest.mock import PropertyMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.unifi.const import CONF_SITE_ID, DOMAIN as UNIFI_DOMAIN
|
||||
from homeassistant.components.unifi.const import CONF_SITE_ID, DOMAIN
|
||||
from homeassistant.components.unifi.services import (
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
SERVICE_REMOVE_CLIENTS,
|
||||
@ -41,7 +41,7 @@ async def test_reconnect_client(
|
||||
)
|
||||
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
service_data={ATTR_DEVICE_ID: device_entry.id},
|
||||
blocking=True,
|
||||
@ -57,7 +57,7 @@ async def test_reconnect_non_existant_device(
|
||||
aioclient_mock.clear_requests()
|
||||
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
service_data={ATTR_DEVICE_ID: "device_entry.id"},
|
||||
blocking=True,
|
||||
@ -80,7 +80,7 @@ async def test_reconnect_device_without_mac(
|
||||
)
|
||||
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
service_data={ATTR_DEVICE_ID: device_entry.id},
|
||||
blocking=True,
|
||||
@ -115,7 +115,7 @@ async def test_reconnect_client_hub_unavailable(
|
||||
) as ws_mock:
|
||||
ws_mock.return_value = False
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
service_data={ATTR_DEVICE_ID: device_entry.id},
|
||||
blocking=True,
|
||||
@ -137,7 +137,7 @@ async def test_reconnect_client_unknown_mac(
|
||||
)
|
||||
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
service_data={ATTR_DEVICE_ID: device_entry.id},
|
||||
blocking=True,
|
||||
@ -163,7 +163,7 @@ async def test_reconnect_wired_client(
|
||||
)
|
||||
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
service_data={ATTR_DEVICE_ID: device_entry.id},
|
||||
blocking=True,
|
||||
@ -213,7 +213,7 @@ async def test_remove_clients(
|
||||
f"/api/s/{config_entry_setup.data[CONF_SITE_ID]}/cmd/stamgr",
|
||||
)
|
||||
|
||||
await hass.services.async_call(UNIFI_DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True)
|
||||
await hass.services.async_call(DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True)
|
||||
assert aioclient_mock.mock_calls[0][2] == {
|
||||
"cmd": "forget-sta",
|
||||
"macs": ["00:00:00:00:00:00", "00:00:00:00:00:01"],
|
||||
@ -244,9 +244,7 @@ async def test_remove_clients_hub_unavailable(
|
||||
"homeassistant.components.unifi.UnifiHub.available", new_callable=PropertyMock
|
||||
) as ws_mock:
|
||||
ws_mock.return_value = False
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True
|
||||
)
|
||||
await hass.services.async_call(DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True)
|
||||
assert aioclient_mock.call_count == 0
|
||||
|
||||
|
||||
@ -268,7 +266,7 @@ async def test_remove_clients_no_call_on_empty_list(
|
||||
) -> None:
|
||||
"""Verify no call is made if no fitting client has been added to the list."""
|
||||
aioclient_mock.clear_requests()
|
||||
await hass.services.async_call(UNIFI_DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True)
|
||||
await hass.services.async_call(DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True)
|
||||
assert aioclient_mock.call_count == 0
|
||||
|
||||
|
||||
@ -297,7 +295,7 @@ async def test_services_handle_unloaded_config_entry(
|
||||
|
||||
aioclient_mock.clear_requests()
|
||||
|
||||
await hass.services.async_call(UNIFI_DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True)
|
||||
await hass.services.async_call(DOMAIN, SERVICE_REMOVE_CLIENTS, blocking=True)
|
||||
assert aioclient_mock.call_count == 0
|
||||
|
||||
device_entry = device_registry.async_get_or_create(
|
||||
@ -305,7 +303,7 @@ async def test_services_handle_unloaded_config_entry(
|
||||
connections={(dr.CONNECTION_NETWORK_MAC, clients_all_payload[0]["mac"])},
|
||||
)
|
||||
await hass.services.async_call(
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_RECONNECT_CLIENT,
|
||||
service_data={ATTR_DEVICE_ID: device_entry.id},
|
||||
blocking=True,
|
||||
|
@ -20,7 +20,7 @@ from homeassistant.components.unifi.const import (
|
||||
CONF_SITE_ID,
|
||||
CONF_TRACK_CLIENTS,
|
||||
CONF_TRACK_DEVICES,
|
||||
DOMAIN as UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.config_entries import RELOAD_AFTER_UPDATE_DELAY
|
||||
from homeassistant.const import (
|
||||
@ -1743,14 +1743,14 @@ async def test_updating_unique_id(
|
||||
"""Verify outlet control and poe control unique ID update works."""
|
||||
entity_registry.async_get_or_create(
|
||||
SWITCH_DOMAIN,
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
f"{device_payload[0]['mac']}-outlet-1",
|
||||
suggested_object_id="plug_outlet_1",
|
||||
config_entry=config_entry,
|
||||
)
|
||||
entity_registry.async_get_or_create(
|
||||
SWITCH_DOMAIN,
|
||||
UNIFI_DOMAIN,
|
||||
DOMAIN,
|
||||
f"{device_payload[1]['mac']}-poe-1",
|
||||
suggested_object_id="switch_port_1_poe",
|
||||
config_entry=config_entry,
|
||||
|
@ -5,7 +5,7 @@ from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.vacuum import DOMAIN as VACUUM_DOMAIN, VacuumEntityFeature
|
||||
from homeassistant.components.vacuum import DOMAIN, VacuumEntityFeature
|
||||
from homeassistant.config_entries import ConfigEntry, ConfigFlow
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -95,7 +95,7 @@ async def setup_vacuum_platform_test_entity(
|
||||
|
||||
mock_platform(
|
||||
hass,
|
||||
f"{TEST_DOMAIN}.{VACUUM_DOMAIN}",
|
||||
f"{TEST_DOMAIN}.{DOMAIN}",
|
||||
MockPlatform(async_setup_entry=async_setup_entry_platform),
|
||||
)
|
||||
|
||||
|
@ -10,7 +10,7 @@ import pytest
|
||||
|
||||
from homeassistant.components import vacuum
|
||||
from homeassistant.components.vacuum import (
|
||||
DOMAIN as VACUUM_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_CLEAN_SPOT,
|
||||
SERVICE_LOCATE,
|
||||
SERVICE_PAUSE,
|
||||
@ -120,13 +120,11 @@ async def test_state_services(
|
||||
async_unload_entry=help_async_unload_entry,
|
||||
),
|
||||
)
|
||||
setup_test_component_platform(
|
||||
hass, VACUUM_DOMAIN, [mock_vacuum], from_config_entry=True
|
||||
)
|
||||
setup_test_component_platform(hass, DOMAIN, [mock_vacuum], from_config_entry=True)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
await hass.services.async_call(
|
||||
VACUUM_DOMAIN,
|
||||
DOMAIN,
|
||||
service,
|
||||
{"entity_id": mock_vacuum.entity_id},
|
||||
blocking=True,
|
||||
@ -153,16 +151,14 @@ async def test_fan_speed(hass: HomeAssistant, config_flow_fixture: None) -> None
|
||||
async_unload_entry=help_async_unload_entry,
|
||||
),
|
||||
)
|
||||
setup_test_component_platform(
|
||||
hass, VACUUM_DOMAIN, [mock_vacuum], from_config_entry=True
|
||||
)
|
||||
setup_test_component_platform(hass, DOMAIN, [mock_vacuum], from_config_entry=True)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
config_entry = MockConfigEntry(domain="test", data={})
|
||||
config_entry.add_to_hass(hass)
|
||||
|
||||
await hass.services.async_call(
|
||||
VACUUM_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_FAN_SPEED,
|
||||
{"entity_id": mock_vacuum.entity_id, "fan_speed": "high"},
|
||||
blocking=True,
|
||||
@ -201,13 +197,11 @@ async def test_locate(hass: HomeAssistant, config_flow_fixture: None) -> None:
|
||||
async_unload_entry=help_async_unload_entry,
|
||||
),
|
||||
)
|
||||
setup_test_component_platform(
|
||||
hass, VACUUM_DOMAIN, [mock_vacuum], from_config_entry=True
|
||||
)
|
||||
setup_test_component_platform(hass, DOMAIN, [mock_vacuum], from_config_entry=True)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
await hass.services.async_call(
|
||||
VACUUM_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_LOCATE,
|
||||
{"entity_id": mock_vacuum.entity_id},
|
||||
blocking=True,
|
||||
@ -252,13 +246,11 @@ async def test_send_command(hass: HomeAssistant, config_flow_fixture: None) -> N
|
||||
async_unload_entry=help_async_unload_entry,
|
||||
),
|
||||
)
|
||||
setup_test_component_platform(
|
||||
hass, VACUUM_DOMAIN, [mock_vacuum], from_config_entry=True
|
||||
)
|
||||
setup_test_component_platform(hass, DOMAIN, [mock_vacuum], from_config_entry=True)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
await hass.services.async_call(
|
||||
VACUUM_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SEND_COMMAND,
|
||||
{
|
||||
"entity_id": mock_vacuum.entity_id,
|
||||
@ -355,7 +347,7 @@ async def test_vacuum_log_deprecated_state_warning_using_state_prop(
|
||||
),
|
||||
built_in=False,
|
||||
)
|
||||
setup_test_component_platform(hass, VACUUM_DOMAIN, [entity], from_config_entry=True)
|
||||
setup_test_component_platform(hass, DOMAIN, [entity], from_config_entry=True)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
state = hass.states.get(entity.entity_id)
|
||||
@ -398,7 +390,7 @@ async def test_vacuum_log_deprecated_state_warning_using_attr_state_attr(
|
||||
),
|
||||
built_in=False,
|
||||
)
|
||||
setup_test_component_platform(hass, VACUUM_DOMAIN, [entity], from_config_entry=True)
|
||||
setup_test_component_platform(hass, DOMAIN, [entity], from_config_entry=True)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
state = hass.states.get(entity.entity_id)
|
||||
@ -462,7 +454,7 @@ async def test_vacuum_deprecated_state_does_not_break_state(
|
||||
),
|
||||
built_in=False,
|
||||
)
|
||||
setup_test_component_platform(hass, VACUUM_DOMAIN, [entity], from_config_entry=True)
|
||||
setup_test_component_platform(hass, DOMAIN, [entity], from_config_entry=True)
|
||||
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
|
||||
state = hass.states.get(entity.entity_id)
|
||||
@ -470,7 +462,7 @@ async def test_vacuum_deprecated_state_does_not_break_state(
|
||||
assert state.state == "docked"
|
||||
|
||||
await hass.services.async_call(
|
||||
VACUUM_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_START,
|
||||
{
|
||||
"entity_id": entity.entity_id,
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components.venstar.const import DOMAIN as VENSTAR_DOMAIN
|
||||
from homeassistant.components.venstar.const import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntryState
|
||||
from homeassistant.const import CONF_HOST, CONF_SSL
|
||||
from homeassistant.core import HomeAssistant
|
||||
@ -17,7 +17,7 @@ TEST_HOST = "venstartest.localdomain"
|
||||
async def test_setup_entry(hass: HomeAssistant) -> None:
|
||||
"""Validate that setup entry also configure the client."""
|
||||
config_entry = MockConfigEntry(
|
||||
domain=VENSTAR_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
data={
|
||||
CONF_HOST: TEST_HOST,
|
||||
CONF_SSL: False,
|
||||
@ -64,7 +64,7 @@ async def test_setup_entry(hass: HomeAssistant) -> None:
|
||||
async def test_setup_entry_exception(hass: HomeAssistant) -> None:
|
||||
"""Validate that setup entry also configure the client."""
|
||||
config_entry = MockConfigEntry(
|
||||
domain=VENSTAR_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
data={
|
||||
CONF_HOST: TEST_HOST,
|
||||
CONF_SSL: False,
|
||||
|
@ -6,7 +6,7 @@ import pytest
|
||||
import pywilight
|
||||
|
||||
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
|
||||
from homeassistant.components.wilight import DOMAIN as WILIGHT_DOMAIN
|
||||
from homeassistant.components.wilight import DOMAIN
|
||||
from homeassistant.components.wilight.switch import (
|
||||
ATTR_PAUSE_TIME,
|
||||
ATTR_TRIGGER,
|
||||
@ -159,7 +159,7 @@ async def test_switch_services(
|
||||
|
||||
# Set watering time
|
||||
await hass.services.async_call(
|
||||
WILIGHT_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_WATERING_TIME,
|
||||
{ATTR_WATERING_TIME: 30, ATTR_ENTITY_ID: "switch.wl000000000099_1_watering"},
|
||||
blocking=True,
|
||||
@ -172,7 +172,7 @@ async def test_switch_services(
|
||||
|
||||
# Set pause time
|
||||
await hass.services.async_call(
|
||||
WILIGHT_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_PAUSE_TIME,
|
||||
{ATTR_PAUSE_TIME: 18, ATTR_ENTITY_ID: "switch.wl000000000099_2_pause"},
|
||||
blocking=True,
|
||||
@ -185,7 +185,7 @@ async def test_switch_services(
|
||||
|
||||
# Set trigger_1
|
||||
await hass.services.async_call(
|
||||
WILIGHT_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_TRIGGER,
|
||||
{
|
||||
ATTR_TRIGGER_INDEX: "1",
|
||||
@ -202,7 +202,7 @@ async def test_switch_services(
|
||||
|
||||
# Set trigger_2
|
||||
await hass.services.async_call(
|
||||
WILIGHT_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_TRIGGER,
|
||||
{
|
||||
ATTR_TRIGGER_INDEX: "2",
|
||||
@ -219,7 +219,7 @@ async def test_switch_services(
|
||||
|
||||
# Set trigger_3
|
||||
await hass.services.async_call(
|
||||
WILIGHT_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_TRIGGER,
|
||||
{
|
||||
ATTR_TRIGGER_INDEX: "3",
|
||||
@ -236,7 +236,7 @@ async def test_switch_services(
|
||||
|
||||
# Set trigger_4
|
||||
await hass.services.async_call(
|
||||
WILIGHT_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_TRIGGER,
|
||||
{
|
||||
ATTR_TRIGGER_INDEX: "4",
|
||||
@ -254,7 +254,7 @@ async def test_switch_services(
|
||||
# Set watering time using WiLight Pause Switch to raise
|
||||
with pytest.raises(TypeError) as exc_info:
|
||||
await hass.services.async_call(
|
||||
WILIGHT_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_WATERING_TIME,
|
||||
{ATTR_WATERING_TIME: 30, ATTR_ENTITY_ID: "switch.wl000000000099_2_pause"},
|
||||
blocking=True,
|
||||
|
@ -7,7 +7,7 @@ import pytest
|
||||
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
|
||||
from homeassistant.components.xiaomi_miio.const import (
|
||||
CONF_FLOW_TYPE,
|
||||
DOMAIN as XIAOMI_DOMAIN,
|
||||
DOMAIN,
|
||||
MODELS_VACUUM,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
@ -84,7 +84,7 @@ async def setup_component(hass: HomeAssistant, entity_name: str) -> str:
|
||||
entity_id = f"{BUTTON_DOMAIN}.{entity_name}"
|
||||
|
||||
config_entry = MockConfigEntry(
|
||||
domain=XIAOMI_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
unique_id="123456",
|
||||
title=entity_name,
|
||||
data={
|
||||
|
@ -18,7 +18,7 @@ from homeassistant.components.select import (
|
||||
from homeassistant.components.xiaomi_miio import UPDATE_INTERVAL
|
||||
from homeassistant.components.xiaomi_miio.const import (
|
||||
CONF_FLOW_TYPE,
|
||||
DOMAIN as XIAOMI_DOMAIN,
|
||||
DOMAIN,
|
||||
MODEL_AIRFRESH_T2017,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
@ -146,7 +146,7 @@ async def setup_component(hass: HomeAssistant, entity_name: str) -> str:
|
||||
entity_id = f"{SELECT_DOMAIN}.{entity_name}"
|
||||
|
||||
config_entry = MockConfigEntry(
|
||||
domain=XIAOMI_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
unique_id="123456",
|
||||
title=entity_name,
|
||||
data={
|
||||
|
@ -25,7 +25,7 @@ from homeassistant.components.vacuum import (
|
||||
)
|
||||
from homeassistant.components.xiaomi_miio.const import (
|
||||
CONF_FLOW_TYPE,
|
||||
DOMAIN as XIAOMI_DOMAIN,
|
||||
DOMAIN,
|
||||
MODELS_VACUUM,
|
||||
)
|
||||
from homeassistant.components.xiaomi_miio.vacuum import (
|
||||
@ -471,7 +471,7 @@ async def test_xiaomi_specific_services(
|
||||
device_method_attr.side_effect = error
|
||||
|
||||
await hass.services.async_call(
|
||||
XIAOMI_DOMAIN,
|
||||
DOMAIN,
|
||||
service,
|
||||
service_data,
|
||||
blocking=True,
|
||||
@ -537,7 +537,7 @@ async def setup_component(hass: HomeAssistant, entity_name: str) -> str:
|
||||
entity_id = f"{VACUUM_DOMAIN}.{entity_name}"
|
||||
|
||||
config_entry = MockConfigEntry(
|
||||
domain=XIAOMI_DOMAIN,
|
||||
domain=DOMAIN,
|
||||
unique_id="123456",
|
||||
title=entity_name,
|
||||
data={
|
||||
|
@ -1,13 +1,13 @@
|
||||
"""Tests for the ZAMG component."""
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.zamg.const import CONF_STATION_ID, DOMAIN as ZAMG_DOMAIN
|
||||
from homeassistant.components.zamg.const import CONF_STATION_ID, DOMAIN
|
||||
|
||||
from .conftest import TEST_STATION_ID, TEST_STATION_NAME
|
||||
|
||||
FIXTURE_CONFIG_ENTRY = {
|
||||
"entry_id": "1",
|
||||
"domain": ZAMG_DOMAIN,
|
||||
"domain": DOMAIN,
|
||||
"title": TEST_STATION_NAME,
|
||||
"data": {
|
||||
CONF_STATION_ID: TEST_STATION_ID,
|
||||
|
@ -4,7 +4,7 @@ import pytest
|
||||
|
||||
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
|
||||
from homeassistant.components.weather import DOMAIN as WEATHER_DOMAIN
|
||||
from homeassistant.components.zamg.const import CONF_STATION_ID, DOMAIN as ZAMG_DOMAIN
|
||||
from homeassistant.components.zamg.const import CONF_STATION_ID, DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
@ -25,7 +25,7 @@ from tests.common import MockConfigEntry
|
||||
(
|
||||
{
|
||||
"domain": WEATHER_DOMAIN,
|
||||
"platform": ZAMG_DOMAIN,
|
||||
"platform": DOMAIN,
|
||||
"unique_id": f"{TEST_STATION_NAME}_{TEST_STATION_ID}",
|
||||
"suggested_object_id": f"Zamg {TEST_STATION_NAME}",
|
||||
"disabled_by": None,
|
||||
@ -37,7 +37,7 @@ from tests.common import MockConfigEntry
|
||||
(
|
||||
{
|
||||
"domain": WEATHER_DOMAIN,
|
||||
"platform": ZAMG_DOMAIN,
|
||||
"platform": DOMAIN,
|
||||
"unique_id": f"{TEST_STATION_NAME_2}_{TEST_STATION_ID_2}",
|
||||
"suggested_object_id": f"Zamg {TEST_STATION_NAME_2}",
|
||||
"disabled_by": None,
|
||||
@ -49,7 +49,7 @@ from tests.common import MockConfigEntry
|
||||
(
|
||||
{
|
||||
"domain": SENSOR_DOMAIN,
|
||||
"platform": ZAMG_DOMAIN,
|
||||
"platform": DOMAIN,
|
||||
"unique_id": f"{TEST_STATION_NAME_2}_{TEST_STATION_ID_2}_temperature",
|
||||
"suggested_object_id": f"Zamg {TEST_STATION_NAME_2}",
|
||||
"disabled_by": None,
|
||||
@ -95,7 +95,7 @@ async def test_migrate_unique_ids(
|
||||
(
|
||||
{
|
||||
"domain": WEATHER_DOMAIN,
|
||||
"platform": ZAMG_DOMAIN,
|
||||
"platform": DOMAIN,
|
||||
"unique_id": f"{TEST_STATION_NAME}_{TEST_STATION_ID}",
|
||||
"suggested_object_id": f"Zamg {TEST_STATION_NAME}",
|
||||
"disabled_by": None,
|
||||
@ -123,7 +123,7 @@ async def test_dont_migrate_unique_ids(
|
||||
# create existing entry with new_unique_id
|
||||
existing_entity = entity_registry.async_get_or_create(
|
||||
WEATHER_DOMAIN,
|
||||
ZAMG_DOMAIN,
|
||||
DOMAIN,
|
||||
unique_id=TEST_STATION_ID,
|
||||
suggested_object_id=f"Zamg {TEST_STATION_NAME}",
|
||||
config_entry=mock_config_entry,
|
||||
@ -156,7 +156,7 @@ async def test_dont_migrate_unique_ids(
|
||||
(
|
||||
{
|
||||
"domain": WEATHER_DOMAIN,
|
||||
"platform": ZAMG_DOMAIN,
|
||||
"platform": DOMAIN,
|
||||
"unique_id": TEST_STATION_ID,
|
||||
"suggested_object_id": f"Zamg {TEST_STATION_NAME}",
|
||||
"disabled_by": None,
|
||||
@ -178,7 +178,7 @@ async def test_unload_entry(
|
||||
|
||||
entity_registry.async_get_or_create(
|
||||
WEATHER_DOMAIN,
|
||||
ZAMG_DOMAIN,
|
||||
DOMAIN,
|
||||
unique_id=TEST_STATION_ID,
|
||||
suggested_object_id=f"Zamg {TEST_STATION_NAME}",
|
||||
config_entry=mock_config_entry,
|
||||
|
@ -20,7 +20,7 @@ from homeassistant.components.lock import (
|
||||
from homeassistant.components.zwave_js.const import (
|
||||
ATTR_LOCK_TIMEOUT,
|
||||
ATTR_OPERATION_TYPE,
|
||||
DOMAIN as ZWAVE_JS_DOMAIN,
|
||||
DOMAIN,
|
||||
)
|
||||
from homeassistant.components.zwave_js.helpers import ZwaveValueMatcher
|
||||
from homeassistant.components.zwave_js.lock import (
|
||||
@ -119,7 +119,7 @@ async def test_door_lock(
|
||||
|
||||
# Test set usercode service
|
||||
await hass.services.async_call(
|
||||
ZWAVE_JS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_LOCK_USERCODE,
|
||||
{
|
||||
ATTR_ENTITY_ID: SCHLAGE_BE469_LOCK_ENTITY,
|
||||
@ -145,7 +145,7 @@ async def test_door_lock(
|
||||
|
||||
# Test clear usercode
|
||||
await hass.services.async_call(
|
||||
ZWAVE_JS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_CLEAR_LOCK_USERCODE,
|
||||
{ATTR_ENTITY_ID: SCHLAGE_BE469_LOCK_ENTITY, ATTR_CODE_SLOT: 1},
|
||||
blocking=True,
|
||||
@ -171,7 +171,7 @@ async def test_door_lock(
|
||||
}
|
||||
caplog.clear()
|
||||
await hass.services.async_call(
|
||||
ZWAVE_JS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_LOCK_CONFIGURATION,
|
||||
{
|
||||
ATTR_ENTITY_ID: SCHLAGE_BE469_LOCK_ENTITY,
|
||||
@ -216,7 +216,7 @@ async def test_door_lock(
|
||||
node.receive_event(event)
|
||||
|
||||
await hass.services.async_call(
|
||||
ZWAVE_JS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_LOCK_CONFIGURATION,
|
||||
{
|
||||
ATTR_ENTITY_ID: SCHLAGE_BE469_LOCK_ENTITY,
|
||||
@ -261,7 +261,7 @@ async def test_door_lock(
|
||||
# Test set usercode service error handling
|
||||
with pytest.raises(HomeAssistantError):
|
||||
await hass.services.async_call(
|
||||
ZWAVE_JS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_SET_LOCK_USERCODE,
|
||||
{
|
||||
ATTR_ENTITY_ID: SCHLAGE_BE469_LOCK_ENTITY,
|
||||
@ -274,7 +274,7 @@ async def test_door_lock(
|
||||
# Test clear usercode service error handling
|
||||
with pytest.raises(HomeAssistantError):
|
||||
await hass.services.async_call(
|
||||
ZWAVE_JS_DOMAIN,
|
||||
DOMAIN,
|
||||
SERVICE_CLEAR_LOCK_USERCODE,
|
||||
{ATTR_ENTITY_ID: SCHLAGE_BE469_LOCK_ENTITY, ATTR_CODE_SLOT: 1},
|
||||
blocking=True,
|
||||
|
Loading…
x
Reference in New Issue
Block a user