diff --git a/tests/test_devices.py b/tests/test_devices.py new file mode 100644 index 0000000..2b6a740 --- /dev/null +++ b/tests/test_devices.py @@ -0,0 +1,9 @@ +"""Test the devices.""" +from vivintpy.devices import get_device_class +from vivintpy.devices.switch import BinarySwitch +from vivintpy.enums import DeviceType + + +def test_get_device_class() -> None: + """Test get device class.""" + assert get_device_class(DeviceType.BINARY_SWITCH.value) == BinarySwitch diff --git a/vivintpy/devices/__init__.py b/vivintpy/devices/__init__.py index 2e9b574..e1d0405 100644 --- a/vivintpy/devices/__init__.py +++ b/vivintpy/devices/__init__.py @@ -24,7 +24,7 @@ def get_device_class(device_type: str) -> Type[VivintDevice]: """Map a device_type string to the class that implements that device.""" - # pylint: disable=import-outside-toplevel + # pylint: disable=import-outside-toplevel,cyclic-import from .camera import Camera from .door_lock import DoorLock from .garage_door import GarageDoor