Move imports in thermoworks_smoke component (#27586)

pull/27598/head
Michał Mrozek 2019-10-13 14:42:29 +02:00 committed by Martin Hjelmare
parent b570be47ca
commit bb2a1cd439
1 changed files with 9 additions and 9 deletions

View File

@ -9,18 +9,21 @@ https://home-assistant.io/components/sensor.thermoworks_smoke/
import logging
from requests import RequestException
from requests.exceptions import HTTPError
from stringcase import camelcase, snakecase
import thermoworks_smoke
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
TEMP_FAHRENHEIT,
CONF_EMAIL,
CONF_PASSWORD,
CONF_MONITORED_CONDITIONS,
CONF_EXCLUDE,
ATTR_BATTERY_LEVEL,
CONF_EMAIL,
CONF_EXCLUDE,
CONF_MONITORED_CONDITIONS,
CONF_PASSWORD,
TEMP_FAHRENHEIT,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
@ -65,8 +68,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the thermoworks sensor."""
import thermoworks_smoke
from requests.exceptions import HTTPError
email = config[CONF_EMAIL]
password = config[CONF_PASSWORD]
@ -144,7 +145,6 @@ class ThermoworksSmokeSensor(Entity):
def update(self):
"""Get the monitored data from firebase."""
from stringcase import camelcase, snakecase
try:
values = self.mgr.data(self.serial)