Move imports to top for kwb (#29404)

This commit is contained in:
springstan 2019-12-04 10:50:22 +01:00 committed by Fabian Affolter
parent 2df189b58e
commit fd107f2b2e

View file

@ -1,18 +1,19 @@
"""Support for KWB Easyfire.""" """Support for KWB Easyfire."""
import logging import logging
from pykwb import kwb
import voluptuous as vol import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ( from homeassistant.const import (
CONF_HOST,
CONF_PORT,
CONF_DEVICE, CONF_DEVICE,
CONF_HOST,
CONF_NAME, CONF_NAME,
CONF_PORT,
EVENT_HOMEASSISTANT_STOP, EVENT_HOMEASSISTANT_STOP,
) )
from homeassistant.helpers.entity import Entity
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -56,8 +57,6 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
raw = config.get(CONF_RAW) raw = config.get(CONF_RAW)
client_name = config.get(CONF_NAME) client_name = config.get(CONF_NAME)
from pykwb import kwb
if connection_type == "serial": if connection_type == "serial":
easyfire = kwb.KWBEasyfire(MODE_SERIAL, "", 0, device) easyfire = kwb.KWBEasyfire(MODE_SERIAL, "", 0, device)
elif connection_type == "tcp": elif connection_type == "tcp":