mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 19:57:07 +00:00
Move imports to top for orvibo (#29371)
This commit is contained in:
parent
f8ffcd6caf
commit
f220c73e8f
@ -1,15 +1,16 @@
|
|||||||
"""Support for Orvibo S20 Wifi Smart Switches."""
|
"""Support for Orvibo S20 Wifi Smart Switches."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from orvibo.s20 import S20, S20Exception, discover
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
|
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
|
CONF_DISCOVERY,
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
|
CONF_MAC,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
CONF_SWITCHES,
|
CONF_SWITCHES,
|
||||||
CONF_MAC,
|
|
||||||
CONF_DISCOVERY,
|
|
||||||
)
|
)
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
@ -37,7 +38,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||||||
|
|
||||||
def setup_platform(hass, config, add_entities_callback, discovery_info=None):
|
def setup_platform(hass, config, add_entities_callback, discovery_info=None):
|
||||||
"""Set up S20 switches."""
|
"""Set up S20 switches."""
|
||||||
from orvibo.s20 import discover, S20, S20Exception
|
|
||||||
|
|
||||||
switch_data = {}
|
switch_data = {}
|
||||||
switches = []
|
switches = []
|
||||||
@ -67,7 +67,6 @@ class S20Switch(SwitchDevice):
|
|||||||
|
|
||||||
def __init__(self, name, s20):
|
def __init__(self, name, s20):
|
||||||
"""Initialize the S20 device."""
|
"""Initialize the S20 device."""
|
||||||
from orvibo.s20 import S20Exception
|
|
||||||
|
|
||||||
self._name = name
|
self._name = name
|
||||||
self._s20 = s20
|
self._s20 = s20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user