diff --git a/homeassistant/components/apcupsd/__init__.py b/homeassistant/components/apcupsd/__init__.py index 512bd01b72a..71f25f04387 100644 --- a/homeassistant/components/apcupsd/__init__.py +++ b/homeassistant/components/apcupsd/__init__.py @@ -1,7 +1,8 @@ """Support for APCUPSd via its Network Information Server (NIS).""" -import logging from datetime import timedelta +import logging +from apcaccess import status import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_PORT @@ -64,7 +65,6 @@ class APCUPSdData: def __init__(self, host, port): """Initialize the data object.""" - from apcaccess import status self._host = host self._port = port diff --git a/homeassistant/components/apcupsd/sensor.py b/homeassistant/components/apcupsd/sensor.py index 837e6e45c6c..255eb1624ff 100644 --- a/homeassistant/components/apcupsd/sensor.py +++ b/homeassistant/components/apcupsd/sensor.py @@ -1,12 +1,13 @@ """Support for APCUPSd sensors.""" import logging +from apcaccess.status import ALL_UNITS import voluptuous as vol -from homeassistant.components.sensor import PLATFORM_SCHEMA -import homeassistant.helpers.config_validation as cv from homeassistant.components import apcupsd -from homeassistant.const import TEMP_CELSIUS, CONF_RESOURCES, POWER_WATT +from homeassistant.components.sensor import PLATFORM_SCHEMA +from homeassistant.const import CONF_RESOURCES, POWER_WATT, TEMP_CELSIUS +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity _LOGGER = logging.getLogger(__name__) @@ -135,7 +136,6 @@ def infer_unit(value): Split the unit off the end of the value and return the value, unit tuple pair. Else return the original value and None as the unit. """ - from apcaccess.status import ALL_UNITS for unit in ALL_UNITS: if value.endswith(unit):