diff --git a/homeassistant/components/ebusd/__init__.py b/homeassistant/components/ebusd/__init__.py index e11de446e40..e4d0bdbcdb1 100644 --- a/homeassistant/components/ebusd/__init__.py +++ b/homeassistant/components/ebusd/__init__.py @@ -3,13 +3,14 @@ from datetime import timedelta import logging import socket +import ebusdpy import voluptuous as vol from homeassistant.const import ( - CONF_NAME, CONF_HOST, - CONF_PORT, CONF_MONITORED_CONDITIONS, + CONF_NAME, + CONF_PORT, ) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import load_platform @@ -66,7 +67,6 @@ def setup(hass, config): try: _LOGGER.debug("Ebusd integration setup started") - import ebusdpy ebusdpy.init(server_address) hass.data[DOMAIN] = EbusdData(server_address, circuit) @@ -98,8 +98,6 @@ class EbusdData: @Throttle(MIN_TIME_BETWEEN_UPDATES) def update(self, name, stype): """Call the Ebusd API to update the data.""" - import ebusdpy - try: _LOGGER.debug("Opening socket to ebusd %s", name) command_result = ebusdpy.read( @@ -116,8 +114,6 @@ class EbusdData: def write(self, call): """Call write methon on ebusd.""" - import ebusdpy - name = call.data.get("name") value = call.data.get("value") diff --git a/homeassistant/components/ebusd/const.py b/homeassistant/components/ebusd/const.py index db79d81736e..ec097a153c9 100644 --- a/homeassistant/components/ebusd/const.py +++ b/homeassistant/components/ebusd/const.py @@ -1,5 +1,5 @@ """Constants for ebus component.""" -from homeassistant.const import ENERGY_KILO_WATT_HOUR, TEMP_CELSIUS, PRESSURE_BAR +from homeassistant.const import ENERGY_KILO_WATT_HOUR, PRESSURE_BAR, TEMP_CELSIUS DOMAIN = "ebusd" TIME_SECONDS = "seconds" diff --git a/homeassistant/components/ebusd/sensor.py b/homeassistant/components/ebusd/sensor.py index 4bc79e7bd39..63f72a89ccd 100644 --- a/homeassistant/components/ebusd/sensor.py +++ b/homeassistant/components/ebusd/sensor.py @@ -1,6 +1,6 @@ """Support for Ebusd sensors.""" -import logging import datetime +import logging from homeassistant.helpers.entity import Entity import homeassistant.util.dt as dt_util