mirror of
https://github.com/home-assistant/core.git
synced 2025-08-15 10:31:39 +02:00
Move imports in dte_energy_bridge component (#27975)
This commit is contained in:
committed by
Martin Hjelmare
parent
425e7fd1a7
commit
c44163548d
@@ -1,12 +1,13 @@
|
|||||||
"""Support for monitoring energy usage using the DTE energy bridge."""
|
"""Support for monitoring energy usage using the DTE energy bridge."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import requests
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.helpers.entity import Entity
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
from homeassistant.helpers.entity import Entity
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -78,8 +79,6 @@ class DteEnergyBridgeSensor(Entity):
|
|||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the energy usage data from the DTE energy bridge."""
|
"""Get the energy usage data from the DTE energy bridge."""
|
||||||
import requests
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(self._url, timeout=5)
|
response = requests.get(self._url, timeout=5)
|
||||||
except (requests.exceptions.RequestException, ValueError):
|
except (requests.exceptions.RequestException, ValueError):
|
||||||
|
Reference in New Issue
Block a user