mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
Move imports to top for qwikswitch (#29328)
This commit is contained in:
parent
83b21651ce
commit
141fd1bffd
@ -1,6 +1,8 @@
|
|||||||
"""Support for Qwikswitch devices."""
|
"""Support for Qwikswitch devices."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from pyqwikswitch.async_ import QSUsb
|
||||||
|
from pyqwikswitch.qwikswitch import CMD_BUTTONS, QS_CMD, QS_ID, SENSORS, QSType
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
|
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
|
||||||
@ -128,8 +130,6 @@ class QSToggleEntity(QSEntity):
|
|||||||
|
|
||||||
async def async_setup(hass, config):
|
async def async_setup(hass, config):
|
||||||
"""Qwiskswitch component setup."""
|
"""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
|
# Add cmd's to in /&listen packets will fire events
|
||||||
# By default only buttons of type [TOGGLE,SCENE EXE,LEVEL]
|
# By default only buttons of type [TOGGLE,SCENE EXE,LEVEL]
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
"""Support for Qwikswitch Binary Sensors."""
|
"""Support for Qwikswitch Binary Sensors."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from pyqwikswitch.qwikswitch import SENSORS
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
|
|
||||||
@ -27,7 +29,6 @@ class QSBinarySensor(QSEntity, BinarySensorDevice):
|
|||||||
|
|
||||||
def __init__(self, sensor):
|
def __init__(self, sensor):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
from pyqwikswitch.qwikswitch import SENSORS
|
|
||||||
|
|
||||||
super().__init__(sensor["id"], sensor["name"])
|
super().__init__(sensor["id"], sensor["name"])
|
||||||
self.channel = sensor["channel"]
|
self.channel = sensor["channel"]
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
"""Support for Qwikswitch Sensors."""
|
"""Support for Qwikswitch Sensors."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from pyqwikswitch.qwikswitch import SENSORS
|
||||||
|
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
|
|
||||||
from . import DOMAIN as QWIKSWITCH, QSEntity
|
from . import DOMAIN as QWIKSWITCH, QSEntity
|
||||||
@ -26,7 +28,6 @@ class QSSensor(QSEntity):
|
|||||||
|
|
||||||
def __init__(self, sensor):
|
def __init__(self, sensor):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
from pyqwikswitch.qwikswitch import SENSORS
|
|
||||||
|
|
||||||
super().__init__(sensor["id"], sensor["name"])
|
super().__init__(sensor["id"], sensor["name"])
|
||||||
self.channel = sensor["channel"]
|
self.channel = sensor["channel"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user