diff --git a/homeassistant/components/smarthab/__init__.py b/homeassistant/components/smarthab/__init__.py index 7206bea110b..ef2da4e9a1d 100644 --- a/homeassistant/components/smarthab/__init__.py +++ b/homeassistant/components/smarthab/__init__.py @@ -6,11 +6,12 @@ https://home-assistant.io/integrations/smarthab/ """ import logging +import pysmarthab import voluptuous as vol -from homeassistant.helpers.discovery import load_platform from homeassistant.const import CONF_EMAIL, CONF_PASSWORD import homeassistant.helpers.config_validation as cv +from homeassistant.helpers.discovery import load_platform DOMAIN = "smarthab" DATA_HUB = "hub" @@ -32,7 +33,6 @@ CONFIG_SCHEMA = vol.Schema( def setup(hass, config) -> bool: """Set up the SmartHab platform.""" - import pysmarthab sh_conf = config.get(DOMAIN) diff --git a/homeassistant/components/smarthab/cover.py b/homeassistant/components/smarthab/cover.py index 3d5b4259aa9..9bcb89b7ab4 100644 --- a/homeassistant/components/smarthab/cover.py +++ b/homeassistant/components/smarthab/cover.py @@ -4,18 +4,21 @@ Support for SmartHab device integration. For more details about this component, please refer to the documentation at https://home-assistant.io/integrations/smarthab/ """ -import logging from datetime import timedelta +import logging + +import pysmarthab from requests.exceptions import Timeout from homeassistant.components.cover import ( - CoverDevice, - SUPPORT_OPEN, - SUPPORT_CLOSE, - SUPPORT_SET_POSITION, ATTR_POSITION, + SUPPORT_CLOSE, + SUPPORT_OPEN, + SUPPORT_SET_POSITION, + CoverDevice, ) -from . import DOMAIN, DATA_HUB + +from . import DATA_HUB, DOMAIN _LOGGER = logging.getLogger(__name__) @@ -24,7 +27,6 @@ SCAN_INTERVAL = timedelta(seconds=60) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the SmartHab roller shutters platform.""" - import pysmarthab hub = hass.data[DOMAIN][DATA_HUB] devices = hub.get_device_list() diff --git a/homeassistant/components/smarthab/light.py b/homeassistant/components/smarthab/light.py index a8a55dea48a..bc6eb31fd04 100644 --- a/homeassistant/components/smarthab/light.py +++ b/homeassistant/components/smarthab/light.py @@ -4,12 +4,15 @@ Support for SmartHab device integration. For more details about this component, please refer to the documentation at https://home-assistant.io/integrations/smarthab/ """ -import logging from datetime import timedelta +import logging + +import pysmarthab from requests.exceptions import Timeout from homeassistant.components.light import Light -from . import DOMAIN, DATA_HUB + +from . import DATA_HUB, DOMAIN _LOGGER = logging.getLogger(__name__) @@ -18,7 +21,6 @@ SCAN_INTERVAL = timedelta(seconds=60) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the SmartHab lights platform.""" - import pysmarthab hub = hass.data[DOMAIN][DATA_HUB] devices = hub.get_device_list()