Skip to content

Commit

Permalink
Fix cyclic import linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
natekspencer committed Feb 20, 2024
1 parent cc0e1f3 commit 7a13585
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions vivintpy/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@

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
from .switch import BinarySwitch, MultilevelSwitch
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,
Expand Down

0 comments on commit 7a13585

Please sign in to comment.