diff --git a/README.md b/README.md index 5e3f888..097e20d 100644 --- a/README.md +++ b/README.md @@ -110,17 +110,16 @@ custom_components/localthings/ sensor.py / binary_sensor.py / switch.py / number.py / select.py / button.py / time.py One module per HA platform strings.json / translations/ Config-flow copy + entity state translations - ocf/ + registry/ batch.py /device/0 batch response parsing - registry/ - capability.py Capability dataclass (href, entities, transforms) - entities.py Per-platform entity descriptor dataclasses - discovery.py Binds a device's live resources to registered capabilities - adapter.py Flattens bound entities into HA-ready state - identity.py Reads device identity (serial, oneUiVersion) for type detection - capabilities/ Shared + per-family Capability definitions (common, dryer, oven, + capability.py Capability dataclass (href, entities, transforms) + entities.py Per-platform entity descriptor dataclasses + discovery.py Binds a device's live resources to registered capabilities + adapter.py Flattens bound entities into HA-ready state + identity.py Reads device identity (serial, oneUiVersion) for type detection + capabilities/ Shared + per-family Capability definitions (common, dryer, oven, dishwasher, fridge, laundry, operational) - by_type/ One DeviceRegistry per appliance type, composed from capabilities/ + by_type/ One DeviceRegistry per appliance type, composed from capabilities/ tests/ 80+ tests: registry composition, discovery, entity descriptors, golden-file regression against captured device dumps requirements-dev.txt Test deps, including the smartthings-local package @@ -132,9 +131,9 @@ docker-compose.yml / ha_config/ Local HA dev environment ## Adding a new appliance type 1. Capture the appliance's `/device/0` response to see what resources/fields it exposes. An authenticated `DtlsCoapSession` from `smartthings_local.protocol.dtls_session` GET is enough; `local-tools/probe_device.py` wraps this. -2. Reuse existing `Capability` objects from `ocf/registry/capabilities/` wherever the resource matches one already declared. Most `common.py` capabilities (power, kids lock, remote control, alarms, energy/water meters) are shared verbatim across families; add new ones only for resources unique to the new type. -3. Create `ocf/registry/by_type/.py` with a `DeviceRegistry(name=..., capabilities=_build([...]))`. Use `pattern_capabilities` instead of `capabilities` for any resource whose `href` isn't fixed (for example per-compartment fridge resources); see `refrigerator.py` for the pattern. -4. Register it in `_REGISTRY_BY_KEY` in `ocf/registry/by_type/__init__.py`, keyed on the lowercased, space/hyphen-to-underscore-converted suffix of the device's `oneUiVersion` string (see `_type_key()` in that file for the exact transform). +2. Reuse existing `Capability` objects from `registry/capabilities/` wherever the resource matches one already declared. Most `common.py` capabilities (power, kids lock, remote control, alarms, energy/water meters) are shared verbatim across families; add new ones only for resources unique to the new type. +3. Create `registry/by_type/.py` with a `DeviceRegistry(name=..., capabilities=_build([...]))`. Use `pattern_capabilities` instead of `capabilities` for any resource whose `href` isn't fixed (for example per-compartment fridge resources); see `refrigerator.py` for the pattern. +4. Register it in `_REGISTRY_BY_KEY` in `registry/by_type/__init__.py`, keyed on the lowercased, space/hyphen-to-underscore-converted suffix of the device's `oneUiVersion` string (see `_type_key()` in that file for the exact transform). 5. Add golden-file coverage in `tests/` against a captured `/device/0` dump for the new type. No config-flow or coordinator changes are needed. Device-type detection and entity wiring are fully driven by the registry. diff --git a/custom_components/localthings/binary_sensor.py b/custom_components/localthings/binary_sensor.py index 42eb927..42674d9 100644 --- a/custom_components/localthings/binary_sensor.py +++ b/custom_components/localthings/binary_sensor.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .ocf.registry.entities import BinarySensorDesc +from .registry.entities import BinarySensorDesc from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/custom_components/localthings/button.py b/custom_components/localthings/button.py index 1283441..39118d5 100644 --- a/custom_components/localthings/button.py +++ b/custom_components/localthings/button.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .ocf.registry.entities import ButtonDesc +from .registry.entities import ButtonDesc from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/custom_components/localthings/config_flow.py b/custom_components/localthings/config_flow.py index 975697c..1ee81d9 100644 --- a/custom_components/localthings/config_flow.py +++ b/custom_components/localthings/config_flow.py @@ -124,7 +124,7 @@ def _probe_and_validate(host: str, ca_cert_pem: str, ca_key_pem: str) -> dict: """Fetch UUID, mint leaf cert, probe each port. Returns config entry data dict.""" import cbor2 from smartthings_local.protocol.dtls_session import DtlsCoapSession - from .ocf.batch import parse_device0_batch + from .registry.batch import parse_device0_batch _LOGGER.debug("Fetching Samsung cloud UUID from %s", _SAMSUNG_CLOUD_HOST) try: diff --git a/custom_components/localthings/coordinator.py b/custom_components/localthings/coordinator.py index fbdace6..4736125 100644 --- a/custom_components/localthings/coordinator.py +++ b/custom_components/localthings/coordinator.py @@ -15,12 +15,12 @@ from homeassistant.helpers.device_registry import DeviceInfo from smartthings_local.protocol.dtls_session import DtlsCoapSession -from .ocf.batch import parse_device0_batch -from .ocf.registry.by_type import for_device -from .ocf.registry.discovery import discover, BoundEntity -from .ocf.registry import CAPABILITIES -from .ocf.registry.adapter import flatten -from .ocf.registry.identity import read_identity, DeviceIdentity +from .registry.batch import parse_device0_batch +from .registry.by_type import for_device +from .registry.discovery import discover, BoundEntity +from .registry import CAPABILITIES +from .registry.adapter import flatten +from .registry.identity import read_identity, DeviceIdentity from .const import ( DOMAIN, CONF_HOST, CONF_PORT, CONF_LEAF_CERT_PEM, CONF_LEAF_KEY_PEM, diff --git a/custom_components/localthings/entity.py b/custom_components/localthings/entity.py index 10b7728..b8a968e 100644 --- a/custom_components/localthings/entity.py +++ b/custom_components/localthings/entity.py @@ -7,8 +7,8 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.const import EntityCategory -from .ocf.registry.adapter import _key -from .ocf.registry.discovery import BoundEntity +from .registry.adapter import _key +from .registry.discovery import BoundEntity from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/custom_components/localthings/number.py b/custom_components/localthings/number.py index 28a87e3..b001374 100644 --- a/custom_components/localthings/number.py +++ b/custom_components/localthings/number.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .ocf.registry.entities import NumberDesc +from .registry.entities import NumberDesc from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/custom_components/localthings/ocf/__init__.py b/custom_components/localthings/ocf/__init__.py deleted file mode 100644 index c134506..0000000 --- a/custom_components/localthings/ocf/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -"""Samsung appliance local-API library (custom_components/localthings/ocf). - -CoAP/DTLS session management, OCF batch resource parsing, and a -capability registry for discovering and reading Samsung appliance state.""" -__version__ = "2.0.0" diff --git a/custom_components/localthings/ocf/registry/__init__.py b/custom_components/localthings/ocf/registry/__init__.py deleted file mode 100644 index 3cb5880..0000000 --- a/custom_components/localthings/ocf/registry/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from .adapter import flatten, is_active, _key -from .discovery import BoundEntity, discover -from .registry import CAPABILITIES - -__all__ = ['CAPABILITIES', 'discover', 'BoundEntity', 'flatten', 'is_active', '_key'] diff --git a/custom_components/localthings/registry/__init__.py b/custom_components/localthings/registry/__init__.py new file mode 100644 index 0000000..c5bc00c --- /dev/null +++ b/custom_components/localthings/registry/__init__.py @@ -0,0 +1,13 @@ +"""Device capability registry for Samsung appliances. + +Declares each appliance family's resources as Capability objects keyed on +their stable OCF resource href, binds a connected device's live resources +to the matching capabilities, and flattens the result into HA-ready entity +state. The DTLS/CoAP transport itself lives in the smartthings-local +package, not here. +""" +from .adapter import flatten, is_active, _key +from .discovery import BoundEntity, discover +from .registry import CAPABILITIES + +__all__ = ['CAPABILITIES', 'discover', 'BoundEntity', 'flatten', 'is_active', '_key'] diff --git a/custom_components/localthings/ocf/registry/adapter.py b/custom_components/localthings/registry/adapter.py similarity index 100% rename from custom_components/localthings/ocf/registry/adapter.py rename to custom_components/localthings/registry/adapter.py diff --git a/custom_components/localthings/ocf/batch.py b/custom_components/localthings/registry/batch.py similarity index 100% rename from custom_components/localthings/ocf/batch.py rename to custom_components/localthings/registry/batch.py diff --git a/custom_components/localthings/ocf/registry/by_type/__init__.py b/custom_components/localthings/registry/by_type/__init__.py similarity index 100% rename from custom_components/localthings/ocf/registry/by_type/__init__.py rename to custom_components/localthings/registry/by_type/__init__.py diff --git a/custom_components/localthings/ocf/registry/by_type/_base.py b/custom_components/localthings/registry/by_type/_base.py similarity index 100% rename from custom_components/localthings/ocf/registry/by_type/_base.py rename to custom_components/localthings/registry/by_type/_base.py diff --git a/custom_components/localthings/ocf/registry/by_type/dishwasher.py b/custom_components/localthings/registry/by_type/dishwasher.py similarity index 100% rename from custom_components/localthings/ocf/registry/by_type/dishwasher.py rename to custom_components/localthings/registry/by_type/dishwasher.py diff --git a/custom_components/localthings/ocf/registry/by_type/dryer.py b/custom_components/localthings/registry/by_type/dryer.py similarity index 100% rename from custom_components/localthings/ocf/registry/by_type/dryer.py rename to custom_components/localthings/registry/by_type/dryer.py diff --git a/custom_components/localthings/ocf/registry/by_type/oven.py b/custom_components/localthings/registry/by_type/oven.py similarity index 100% rename from custom_components/localthings/ocf/registry/by_type/oven.py rename to custom_components/localthings/registry/by_type/oven.py diff --git a/custom_components/localthings/ocf/registry/by_type/refrigerator.py b/custom_components/localthings/registry/by_type/refrigerator.py similarity index 100% rename from custom_components/localthings/ocf/registry/by_type/refrigerator.py rename to custom_components/localthings/registry/by_type/refrigerator.py diff --git a/custom_components/localthings/ocf/registry/capabilities/__init__.py b/custom_components/localthings/registry/capabilities/__init__.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/__init__.py rename to custom_components/localthings/registry/capabilities/__init__.py diff --git a/custom_components/localthings/ocf/registry/capabilities/common.py b/custom_components/localthings/registry/capabilities/common.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/common.py rename to custom_components/localthings/registry/capabilities/common.py diff --git a/custom_components/localthings/ocf/registry/capabilities/dishwasher.py b/custom_components/localthings/registry/capabilities/dishwasher.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/dishwasher.py rename to custom_components/localthings/registry/capabilities/dishwasher.py diff --git a/custom_components/localthings/ocf/registry/capabilities/dryer.py b/custom_components/localthings/registry/capabilities/dryer.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/dryer.py rename to custom_components/localthings/registry/capabilities/dryer.py diff --git a/custom_components/localthings/ocf/registry/capabilities/fridge.py b/custom_components/localthings/registry/capabilities/fridge.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/fridge.py rename to custom_components/localthings/registry/capabilities/fridge.py diff --git a/custom_components/localthings/ocf/registry/capabilities/laundry.py b/custom_components/localthings/registry/capabilities/laundry.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/laundry.py rename to custom_components/localthings/registry/capabilities/laundry.py diff --git a/custom_components/localthings/ocf/registry/capabilities/operational.py b/custom_components/localthings/registry/capabilities/operational.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/operational.py rename to custom_components/localthings/registry/capabilities/operational.py diff --git a/custom_components/localthings/ocf/registry/capabilities/oven.py b/custom_components/localthings/registry/capabilities/oven.py similarity index 100% rename from custom_components/localthings/ocf/registry/capabilities/oven.py rename to custom_components/localthings/registry/capabilities/oven.py diff --git a/custom_components/localthings/ocf/registry/capability.py b/custom_components/localthings/registry/capability.py similarity index 100% rename from custom_components/localthings/ocf/registry/capability.py rename to custom_components/localthings/registry/capability.py diff --git a/custom_components/localthings/ocf/registry/discovery.py b/custom_components/localthings/registry/discovery.py similarity index 100% rename from custom_components/localthings/ocf/registry/discovery.py rename to custom_components/localthings/registry/discovery.py diff --git a/custom_components/localthings/ocf/registry/entities.py b/custom_components/localthings/registry/entities.py similarity index 100% rename from custom_components/localthings/ocf/registry/entities.py rename to custom_components/localthings/registry/entities.py diff --git a/custom_components/localthings/ocf/registry/identity.py b/custom_components/localthings/registry/identity.py similarity index 100% rename from custom_components/localthings/ocf/registry/identity.py rename to custom_components/localthings/registry/identity.py diff --git a/custom_components/localthings/ocf/registry/registry.py b/custom_components/localthings/registry/registry.py similarity index 100% rename from custom_components/localthings/ocf/registry/registry.py rename to custom_components/localthings/registry/registry.py diff --git a/custom_components/localthings/select.py b/custom_components/localthings/select.py index bb4440d..8ffe47a 100644 --- a/custom_components/localthings/select.py +++ b/custom_components/localthings/select.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .ocf.registry.entities import SelectDesc +from .registry.entities import SelectDesc from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/custom_components/localthings/sensor.py b/custom_components/localthings/sensor.py index e9804b6..655bdc1 100644 --- a/custom_components/localthings/sensor.py +++ b/custom_components/localthings/sensor.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .ocf.registry.entities import SensorDesc +from .registry.entities import SensorDesc from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/custom_components/localthings/switch.py b/custom_components/localthings/switch.py index 258333c..1961fbb 100644 --- a/custom_components/localthings/switch.py +++ b/custom_components/localthings/switch.py @@ -6,7 +6,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .ocf.registry.entities import SwitchDesc +from .registry.entities import SwitchDesc from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/custom_components/localthings/time.py b/custom_components/localthings/time.py index c00a58f..dc5be85 100644 --- a/custom_components/localthings/time.py +++ b/custom_components/localthings/time.py @@ -8,7 +8,7 @@ from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback -from .ocf.registry.entities import TimeDesc +from .registry.entities import TimeDesc from .const import DOMAIN from .coordinator import LocalThingsCoordinator diff --git a/tests/conftest.py b/tests/conftest.py index a002b56..de9b260 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ FIXTURES = Path(__file__).resolve().parent / 'fixtures' def _resources_from_dump(dump: dict) -> dict[str, dict]: - from custom_components.localthings.ocf.batch import parse_device0_batch + from custom_components.localthings.registry.batch import parse_device0_batch return parse_device0_batch(dump['device0']) diff --git a/tests/localthings/conftest.py b/tests/localthings/conftest.py index 9bcb9b4..cc4aca8 100644 --- a/tests/localthings/conftest.py +++ b/tests/localthings/conftest.py @@ -57,7 +57,7 @@ ENTRY_DATA = { def _load_fridge_resources() -> dict: - from custom_components.localthings.ocf.batch import parse_device0_batch + from custom_components.localthings.registry.batch import parse_device0_batch data = json.loads((FIXTURES / 'refrigerator_device.json').read_text()) return parse_device0_batch(data['device0']) diff --git a/tests/test_by_type.py b/tests/test_by_type.py index c41e558..3124beb 100644 --- a/tests/test_by_type.py +++ b/tests/test_by_type.py @@ -1,6 +1,6 @@ """Tests for samsung_appliance/registry/by_type.""" import pytest -from custom_components.localthings.ocf.registry.by_type import _type_key, for_device, DeviceRegistry +from custom_components.localthings.registry.by_type import _type_key, for_device, DeviceRegistry class TestTypeKey: diff --git a/tests/test_by_type_capabilities.py b/tests/test_by_type_capabilities.py index f8f399b..9c9e096 100644 --- a/tests/test_by_type_capabilities.py +++ b/tests/test_by_type_capabilities.py @@ -4,10 +4,10 @@ from pathlib import Path import pytest -from custom_components.localthings.ocf.registry.adapter import _key -from custom_components.localthings.ocf.registry.by_type import dishwasher, refrigerator -from custom_components.localthings.ocf.registry.capabilities import fridge -from custom_components.localthings.ocf.registry.discovery import discover +from custom_components.localthings.registry.adapter import _key +from custom_components.localthings.registry.by_type import dishwasher, refrigerator +from custom_components.localthings.registry.capabilities import fridge +from custom_components.localthings.registry.discovery import discover from tests.conftest import _load_resources GOLDEN = Path(__file__).parent / 'fixtures' / 'golden' diff --git a/tests/test_capability.py b/tests/test_capability.py index 0e27111..9e704f1 100644 --- a/tests/test_capability.py +++ b/tests/test_capability.py @@ -1,5 +1,5 @@ -from custom_components.localthings.ocf.registry.capability import Capability -from custom_components.localthings.ocf.registry.entities import BinarySensorDesc +from custom_components.localthings.registry.capability import Capability +from custom_components.localthings.registry.entities import BinarySensorDesc def test_capability_defaults(): diff --git a/tests/test_common_capabilities.py b/tests/test_common_capabilities.py index 2735801..7cc95c9 100644 --- a/tests/test_common_capabilities.py +++ b/tests/test_common_capabilities.py @@ -1,5 +1,5 @@ -from custom_components.localthings.ocf.registry.capabilities import common -from custom_components.localthings.ocf.registry.discovery import discover +from custom_components.localthings.registry.capabilities import common +from custom_components.localthings.registry.discovery import discover def _reg(): diff --git a/tests/test_discovery.py b/tests/test_discovery.py index 10b99e6..ac6227a 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -1,8 +1,8 @@ -from custom_components.localthings.ocf.registry.capability import Capability -from custom_components.localthings.ocf.registry.discovery import ( +from custom_components.localthings.registry.capability import Capability +from custom_components.localthings.registry.discovery import ( BoundEntity, discover, instance_suffix, ) -from custom_components.localthings.ocf.registry.entities import BinarySensorDesc +from custom_components.localthings.registry.entities import BinarySensorDesc LOCK = Capability( href='/kidslock/vs/0', diff --git a/tests/test_end_to_end_v2.py b/tests/test_end_to_end_v2.py index e5a9517..36381bb 100644 --- a/tests/test_end_to_end_v2.py +++ b/tests/test_end_to_end_v2.py @@ -1,8 +1,8 @@ import pytest from tests.conftest import _load_device -from custom_components.localthings.ocf.registry.by_type import for_device, _type_key -from custom_components.localthings.ocf.registry.discovery import discover -from custom_components.localthings.ocf.registry.adapter import flatten, is_active +from custom_components.localthings.registry.by_type import for_device, _type_key +from custom_components.localthings.registry.discovery import discover +from custom_components.localthings.registry.adapter import flatten, is_active @pytest.mark.parametrize('name,expected_type_key', [ diff --git a/tests/test_entities.py b/tests/test_entities.py index 1b8f768..f28fa4a 100644 --- a/tests/test_entities.py +++ b/tests/test_entities.py @@ -1,4 +1,4 @@ -from custom_components.localthings.ocf.registry.entities import ( +from custom_components.localthings.registry.entities import ( SensorDesc, BinarySensorDesc, SelectDesc, SwitchDesc, ButtonDesc, NumberDesc, PLATFORM_OF, ) diff --git a/tests/test_fridge_multi_instance.py b/tests/test_fridge_multi_instance.py index 4c7af69..51fe70e 100644 --- a/tests/test_fridge_multi_instance.py +++ b/tests/test_fridge_multi_instance.py @@ -7,9 +7,9 @@ pattern capability that auto-derives distinct keys from the href segments. """ from tests.conftest import _load_resources -from custom_components.localthings.ocf.registry.adapter import _key -from custom_components.localthings.ocf.registry.by_type import refrigerator -from custom_components.localthings.ocf.registry.discovery import discover +from custom_components.localthings.registry.adapter import _key +from custom_components.localthings.registry.by_type import refrigerator +from custom_components.localthings.registry.discovery import discover def test_two_doors_get_distinct_keys(): diff --git a/tests/test_golden_regression.py b/tests/test_golden_regression.py index 8f81d57..23b1b7b 100644 --- a/tests/test_golden_regression.py +++ b/tests/test_golden_regression.py @@ -7,14 +7,14 @@ GOLDEN = Path(__file__).parent / 'fixtures' / 'golden' def _new_state_keys(name, resources): - from custom_components.localthings.ocf.registry.by_type import for_device - from custom_components.localthings.ocf.registry.discovery import discover - from custom_components.localthings.ocf.registry.adapter import flatten + from custom_components.localthings.registry.by_type import for_device + from custom_components.localthings.registry.discovery import discover + from custom_components.localthings.registry.adapter import flatten otn = resources.get('/otninformation/vs/0', {}) one_ui = otn.get('swVersionInfo', {}).get('oneUiVersion', '') reg = for_device(one_ui) if one_ui else None if reg is None: - from custom_components.localthings.ocf.registry.registry import CAPABILITIES + from custom_components.localthings.registry.registry import CAPABILITIES caps, pats = CAPABILITIES, [] else: caps, pats = reg.capabilities, reg.pattern_capabilities diff --git a/tests/test_identity.py b/tests/test_identity.py index d869817..4d0a138 100644 --- a/tests/test_identity.py +++ b/tests/test_identity.py @@ -1,6 +1,6 @@ import cbor2 -from custom_components.localthings.ocf.registry.identity import DeviceIdentity, read_identity +from custom_components.localthings.registry.identity import DeviceIdentity, read_identity class FakeSession: diff --git a/tests/test_laundry_writes.py b/tests/test_laundry_writes.py index 5d83966..93a5d12 100644 --- a/tests/test_laundry_writes.py +++ b/tests/test_laundry_writes.py @@ -1,6 +1,6 @@ """Write-handler unit tests for laundry-family capabilities.""" -from custom_components.localthings.ocf.registry.capabilities import laundry -from custom_components.localthings.ocf.registry.capabilities.operational import OPERATIONAL_STATE +from custom_components.localthings.registry.capabilities import laundry +from custom_components.localthings.registry.capabilities.operational import OPERATIONAL_STATE def test_start_button_writes_run(): diff --git a/tests/test_operational_capability.py b/tests/test_operational_capability.py index 794e066..ec3adf8 100644 --- a/tests/test_operational_capability.py +++ b/tests/test_operational_capability.py @@ -1,4 +1,4 @@ -from custom_components.localthings.ocf.registry.capabilities.operational import OPERATIONAL_STATE +from custom_components.localthings.registry.capabilities.operational import OPERATIONAL_STATE def test_machine_state_maps_samsung_to_ocf(): diff --git a/tests/test_oven_capabilities.py b/tests/test_oven_capabilities.py index b69c080..8799fa0 100644 --- a/tests/test_oven_capabilities.py +++ b/tests/test_oven_capabilities.py @@ -1,6 +1,6 @@ """Unit tests for oven-family capabilities.""" -from custom_components.localthings.ocf.registry.capabilities import oven -from custom_components.localthings.ocf.registry.discovery import discover +from custom_components.localthings.registry.capabilities import oven +from custom_components.localthings.registry.discovery import discover # --------------------------------------------------------------------------- diff --git a/tests/test_registry.py b/tests/test_registry.py index 69cc9ba..d122dc4 100644 --- a/tests/test_registry.py +++ b/tests/test_registry.py @@ -1,5 +1,5 @@ """Tests for the CAPABILITIES registry.""" -from custom_components.localthings.ocf.registry.registry import CAPABILITIES +from custom_components.localthings.registry.registry import CAPABILITIES def test_registry_is_keyed_by_href():