Move imports to top for orvibo (#29371)

This commit is contained in:
springstan 2019-12-04 00:16:57 +01:00 committed by Alexei Chetroi
parent f8ffcd6caf
commit f220c73e8f

View File

@ -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