Move imports to top for tuya (#29467)

This commit is contained in:
springstan authored and Paulus Schoutsen committed 2019-12-04 21:11:13 -08:00
1 parent 5573504508
commit 72995f6ce6
2 files changed
+6 -5

No files matched your search

+5 -4
View File
@@ -1,13 +1,15 @@
"""Support for Tuya Smart devices."""
from datetime import timedelta
import logging
from tuyaha import TuyaApi
import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_PLATFORM, CONF_USERNAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, CONF_PLATFORM
from homeassistant.helpers import discovery
from homeassistant.helpers.dispatcher import dispatcher_send, async_dispatcher_connect
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_connect, dispatcher_send
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import track_time_interval
@@ -50,7 +52,6 @@ CONFIG_SCHEMA = vol.Schema(
def setup(hass, config):
"""Set up Tuya Component."""
from tuyaha import TuyaApi
tuya = TuyaApi()
username = config[DOMAIN][CONF_USERNAME]
+1 -1
View File
@@ -5,9 +5,9 @@ from homeassistant.components.climate.const import (
HVAC_MODE_COOL,
HVAC_MODE_FAN_ONLY,
HVAC_MODE_HEAT,
HVAC_MODE_OFF,
SUPPORT_FAN_MODE,
SUPPORT_TARGET_TEMPERATURE,
HVAC_MODE_OFF,
)
from homeassistant.components.fan import SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM
from homeassistant.const import (