mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Move imports in ohmconnect component (#28041)
This commit is contained in:
parent
2f96691938
commit
56a7233e0f
@ -1,15 +1,16 @@
|
|||||||
"""Support for OhmConnect."""
|
"""Support for OhmConnect."""
|
||||||
import logging
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import logging
|
||||||
|
|
||||||
|
import defusedxml.ElementTree as ET
|
||||||
import requests
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.util import Throttle
|
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -64,8 +65,6 @@ class OhmconnectSensor(Entity):
|
|||||||
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest data from OhmConnect."""
|
"""Get the latest data from OhmConnect."""
|
||||||
import defusedxml.ElementTree as ET
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
url = ("https://login.ohmconnect.com" "/verify-ohm-hour/{}").format(
|
url = ("https://login.ohmconnect.com" "/verify-ohm-hour/{}").format(
|
||||||
self._ohmid
|
self._ohmid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user