Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add screenlogic service tests #116356

Merged
merged 6 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,6 @@ omit =
homeassistant/components/screenlogic/light.py
homeassistant/components/screenlogic/number.py
homeassistant/components/screenlogic/sensor.py
homeassistant/components/screenlogic/services.py
homeassistant/components/screenlogic/switch.py
homeassistant/components/scsgate/*
homeassistant/components/sendgrid/notify.py
Expand Down
7 changes: 7 additions & 0 deletions tests/components/screenlogic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
MOCK_ADAPTER_IP = "127.0.0.1"
MOCK_ADAPTER_PORT = 80

MOCK_CONFIG_ENTRY_ID = "screenlogictest"
MOCK_DEVICE_AREA = "pool"

_LOGGER = logging.getLogger(__name__)


GATEWAY_IMPORT_PATH = "homeassistant.components.screenlogic.ScreenLogicGateway"
GATEWAY_DISCOVERY_IMPORT_PATH = "homeassistant.components.screenlogic.coordinator.async_discover_gateways_by_unique_id"


Expand All @@ -36,6 +40,9 @@ def num_key_string_to_int(data: dict) -> None:
DATA_FULL_CHEM = num_key_string_to_int(
load_json_object_fixture("screenlogic/data_full_chem.json")
)
DATA_FULL_CHEM_CHLOR = num_key_string_to_int(
load_json_object_fixture("screenlogic/data_full_chem_chlor.json")
)
DATA_FULL_NO_GPM = num_key_string_to_int(
load_json_object_fixture("screenlogic/data_full_no_gpm.json")
)
Expand Down
10 changes: 8 additions & 2 deletions tests/components/screenlogic/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
from homeassistant.components.screenlogic import DOMAIN
from homeassistant.const import CONF_IP_ADDRESS, CONF_PORT, CONF_SCAN_INTERVAL

from . import MOCK_ADAPTER_IP, MOCK_ADAPTER_MAC, MOCK_ADAPTER_NAME, MOCK_ADAPTER_PORT
from . import (
MOCK_ADAPTER_IP,
MOCK_ADAPTER_MAC,
MOCK_ADAPTER_NAME,
MOCK_ADAPTER_PORT,
MOCK_CONFIG_ENTRY_ID,
)

from tests.common import MockConfigEntry

Expand All @@ -24,5 +30,5 @@ def mock_config_entry() -> MockConfigEntry:
CONF_SCAN_INTERVAL: 30,
},
unique_id=MOCK_ADAPTER_MAC,
entry_id="screenlogictest",
entry_id=MOCK_CONFIG_ENTRY_ID,
)