Move flexit imports at top-level (#29097)

This commit is contained in:
Quentame 2019-11-26 19:08:53 +01:00 committed by Paulus Schoutsen
parent 21ed87a773
commit a7c4abba98

View file

@ -13,26 +13,28 @@ https://home-assistant.io/components/climate.flexit/
"""
import logging
from typing import List
from pyflexit.pyflexit import pyflexit
import voluptuous as vol
from homeassistant.const import (
CONF_NAME,
CONF_SLAVE,
TEMP_CELSIUS,
ATTR_TEMPERATURE,
DEVICE_DEFAULT_NAME,
)
from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEMA
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateDevice
from homeassistant.components.climate.const import (
SUPPORT_TARGET_TEMPERATURE,
SUPPORT_FAN_MODE,
HVAC_MODE_COOL,
SUPPORT_FAN_MODE,
SUPPORT_TARGET_TEMPERATURE,
)
from homeassistant.components.modbus import (
CONF_HUB,
DEFAULT_HUB,
DOMAIN as MODBUS_DOMAIN,
)
from homeassistant.const import (
ATTR_TEMPERATURE,
CONF_NAME,
CONF_SLAVE,
DEVICE_DEFAULT_NAME,
TEMP_CELSIUS,
)
import homeassistant.helpers.config_validation as cv
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
@ -61,8 +63,6 @@ class Flexit(ClimateDevice):
def __init__(self, hub, modbus_slave, name):
"""Initialize the unit."""
from pyflexit import pyflexit
self._hub = hub
self._name = name
self._slave = modbus_slave
@ -79,7 +79,7 @@ class Flexit(ClimateDevice):
self._heating = None
self._cooling = None
self._alarm = False
self.unit = pyflexit.pyflexit(hub, modbus_slave)
self.unit = pyflexit(hub, modbus_slave)
@property
def supported_features(self):