Fix incorrect use of Platform enum in wmspro tests (#163152)

This commit is contained in:
epenet
2026-02-16 13:08:43 +01:00
committed by GitHub
parent b8885791f7
commit 4510ca7994
3 changed files with 15 additions and 16 deletions
+6 -6
View File
@@ -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,
+6 -7
View File
@@ -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,
+3 -3
View File
@@ -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,