Move imports to top for qwikswitch (#29328)

This commit is contained in:
springstan 2019-12-03 01:11:10 +01:00 committed by Paulus Schoutsen
parent 83b21651ce
commit 141fd1bffd
3 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,8 @@
"""Support for Qwikswitch devices."""
import logging
from pyqwikswitch.async_ import QSUsb
from pyqwikswitch.qwikswitch import CMD_BUTTONS, QS_CMD, QS_ID, SENSORS, QSType
import voluptuous as vol
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
@ -128,8 +130,6 @@ class QSToggleEntity(QSEntity):
async def async_setup(hass, config):
"""Qwiskswitch component setup."""
from pyqwikswitch.async_ import QSUsb
from pyqwikswitch.qwikswitch import CMD_BUTTONS, QS_CMD, QS_ID, QSType, SENSORS
# Add cmd's to in /&listen packets will fire events
# By default only buttons of type [TOGGLE,SCENE EXE,LEVEL]

View File

@ -1,6 +1,8 @@
"""Support for Qwikswitch Binary Sensors."""
import logging
from pyqwikswitch.qwikswitch import SENSORS
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.core import callback
@ -27,7 +29,6 @@ class QSBinarySensor(QSEntity, BinarySensorDevice):
def __init__(self, sensor):
"""Initialize the sensor."""
from pyqwikswitch.qwikswitch import SENSORS
super().__init__(sensor["id"], sensor["name"])
self.channel = sensor["channel"]

View File

@ -1,6 +1,8 @@
"""Support for Qwikswitch Sensors."""
import logging
from pyqwikswitch.qwikswitch import SENSORS
from homeassistant.core import callback
from . import DOMAIN as QWIKSWITCH, QSEntity
@ -26,7 +28,6 @@ class QSSensor(QSEntity):
def __init__(self, sensor):
"""Initialize the sensor."""
from pyqwikswitch.qwikswitch import SENSORS
super().__init__(sensor["id"], sensor["name"])
self.channel = sensor["channel"]