diff --git a/tests/components/wmspro/test_cover.py b/tests/components/wmspro/test_cover.py index 72b251223dd7..3051d86fe4f8 100644 --- a/tests/components/wmspro/test_cover.py +++ b/tests/components/wmspro/test_cover.py @@ -6,6 +6,7 @@ from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion +from homeassistant.components.cover import DOMAIN as COVER_DOMAIN from homeassistant.components.wmspro.const import DOMAIN from homeassistant.components.wmspro.cover import SCAN_INTERVAL from homeassistant.const import ( @@ -16,7 +17,6 @@ from homeassistant.const import ( SERVICE_STOP_COVER, STATE_CLOSED, STATE_OPEN, - Platform, ) from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr @@ -124,7 +124,7 @@ async def test_cover_open_and_close( before = len(mock_hub_status.mock_calls) await hass.services.async_call( - Platform.COVER, + COVER_DOMAIN, SERVICE_OPEN_COVER, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, @@ -143,7 +143,7 @@ async def test_cover_open_and_close( before = len(mock_hub_status.mock_calls) await hass.services.async_call( - Platform.COVER, + COVER_DOMAIN, SERVICE_CLOSE_COVER, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, @@ -207,7 +207,7 @@ async def test_cover_open_to_pos( before = len(mock_hub_status.mock_calls) await hass.services.async_call( - Platform.COVER, + COVER_DOMAIN, SERVICE_SET_COVER_POSITION, {ATTR_ENTITY_ID: entity.entity_id, "position": 50}, blocking=True, @@ -271,7 +271,7 @@ async def test_cover_open_and_stop( before = len(mock_hub_status.mock_calls) await hass.services.async_call( - Platform.COVER, + COVER_DOMAIN, SERVICE_SET_COVER_POSITION, {ATTR_ENTITY_ID: entity.entity_id, "position": 80}, blocking=True, @@ -290,7 +290,7 @@ async def test_cover_open_and_stop( before = len(mock_hub_status.mock_calls) await hass.services.async_call( - Platform.COVER, + COVER_DOMAIN, SERVICE_STOP_COVER, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, diff --git a/tests/components/wmspro/test_light.py b/tests/components/wmspro/test_light.py index 749c1d9104b1..487a54a8da58 100644 --- a/tests/components/wmspro/test_light.py +++ b/tests/components/wmspro/test_light.py @@ -5,7 +5,7 @@ from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from syrupy.assertion import SnapshotAssertion -from homeassistant.components.light import ATTR_BRIGHTNESS +from homeassistant.components.light import ATTR_BRIGHTNESS, DOMAIN as LIGHT_DOMAIN from homeassistant.components.wmspro.const import DOMAIN from homeassistant.components.wmspro.light import SCAN_INTERVAL from homeassistant.const import ( @@ -14,7 +14,6 @@ from homeassistant.const import ( SERVICE_TURN_ON, STATE_OFF, STATE_ON, - Platform, ) from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr @@ -97,7 +96,7 @@ async def test_light_turn_on_and_off( before = len(mock_hub_status_prod_dimmer.mock_calls) await hass.services.async_call( - Platform.LIGHT, + LIGHT_DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, @@ -116,7 +115,7 @@ async def test_light_turn_on_and_off( before = len(mock_hub_status_prod_dimmer.mock_calls) await hass.services.async_call( - Platform.LIGHT, + LIGHT_DOMAIN, SERVICE_TURN_OFF, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, @@ -155,7 +154,7 @@ async def test_light_dimm_on_and_off( before = len(mock_hub_status_prod_dimmer.mock_calls) await hass.services.async_call( - Platform.LIGHT, + LIGHT_DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, @@ -174,7 +173,7 @@ async def test_light_dimm_on_and_off( before = len(mock_hub_status_prod_dimmer.mock_calls) await hass.services.async_call( - Platform.LIGHT, + LIGHT_DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: entity.entity_id, ATTR_BRIGHTNESS: 128}, blocking=True, @@ -193,7 +192,7 @@ async def test_light_dimm_on_and_off( before = len(mock_hub_status_prod_dimmer.mock_calls) await hass.services.async_call( - Platform.LIGHT, + LIGHT_DOMAIN, SERVICE_TURN_OFF, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, diff --git a/tests/components/wmspro/test_switch.py b/tests/components/wmspro/test_switch.py index 823d553a44bd..7daefc68e8d1 100644 --- a/tests/components/wmspro/test_switch.py +++ b/tests/components/wmspro/test_switch.py @@ -5,6 +5,7 @@ from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from syrupy.assertion import SnapshotAssertion +from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.components.wmspro.const import DOMAIN from homeassistant.components.wmspro.switch import SCAN_INTERVAL from homeassistant.const import ( @@ -13,7 +14,6 @@ from homeassistant.const import ( SERVICE_TURN_ON, STATE_OFF, STATE_ON, - Platform, ) from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr @@ -97,7 +97,7 @@ async def test_switch_turn_on_and_off( before = len(mock_hub_status_prod_load_switch.mock_calls) await hass.services.async_call( - Platform.SWITCH, + SWITCH_DOMAIN, SERVICE_TURN_ON, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True, @@ -115,7 +115,7 @@ async def test_switch_turn_on_and_off( before = len(mock_hub_status_prod_load_switch.mock_calls) await hass.services.async_call( - Platform.SWITCH, + SWITCH_DOMAIN, SERVICE_TURN_OFF, {ATTR_ENTITY_ID: entity.entity_id}, blocking=True,