From 7a13585b829789ba5904a03c0bedd74063f184a0 Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Tue, 20 Feb 2024 15:55:42 -0700 Subject: [PATCH] Fix cyclic import linting error --- vivintpy/devices/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vivintpy/devices/__init__.py b/vivintpy/devices/__init__.py index fb9ca2c..f47ffe8 100644 --- a/vivintpy/devices/__init__.py +++ b/vivintpy/devices/__init__.py @@ -18,13 +18,6 @@ if TYPE_CHECKING: from .alarm_panel import AlarmPanel - -DEVICE = "device" - - -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 from .camera import Camera from .door_lock import DoorLock from .garage_door import GarageDoor @@ -32,6 +25,11 @@ def get_device_class(device_type: str) -> Type[VivintDevice]: from .thermostat import Thermostat from .wireless_sensor import WirelessSensor +DEVICE = "device" + + +def get_device_class(device_type: str) -> Type[VivintDevice]: + """Map a device_type string to the class that implements that device.""" mapping: dict[DeviceType, Type[VivintDevice]] = { DeviceType.BINARY_SWITCH: BinarySwitch, DeviceType.CAMERA: Camera,