Move imports in ohmconnect component (#28041)

pull/28054/head
Diefferson Koderer Môro 2019-10-21 05:03:24 -03:00 committed by Fabian Affolter
parent 2f96691938
commit 56a7233e0f
1 changed files with 3 additions and 4 deletions

View File

@ -1,15 +1,16 @@
"""Support for OhmConnect."""
import logging
from datetime import timedelta
import logging
import defusedxml.ElementTree as ET
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
@ -64,8 +65,6 @@ class OhmconnectSensor(Entity):
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
"""Get the latest data from OhmConnect."""
import defusedxml.ElementTree as ET
try:
url = ("https://login.ohmconnect.com" "/verify-ohm-hour/{}").format(
self._ohmid