diff --git a/homeassistant/components/ebusd/__init__.py b/homeassistant/components/ebusd/__init__.py index 855e62727b5..00c40344d6e 100644 --- a/homeassistant/components/ebusd/__init__.py +++ b/homeassistant/components/ebusd/__init__.py @@ -1,5 +1,4 @@ """Support for Ebusd daemon for communication with eBUS heating systems.""" -from datetime import timedelta import logging import socket @@ -14,7 +13,6 @@ from homeassistant.const import ( ) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.discovery import load_platform -from homeassistant.util import Throttle from .const import DOMAIN, SENSOR_TYPES @@ -26,8 +24,6 @@ CONF_CIRCUIT = "circuit" CACHE_TTL = 900 SERVICE_EBUSD_WRITE = "ebusd_write" -MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=15) - def verify_ebusd_config(config): """Verify eBusd config.""" @@ -59,6 +55,7 @@ CONFIG_SCHEMA = vol.Schema( def setup(hass, config): """Set up the eBusd component.""" + _LOGGER.debug("Integration setup started") conf = config[DOMAIN] name = conf[CONF_NAME] circuit = conf[CONF_CIRCUIT] @@ -66,7 +63,6 @@ def setup(hass, config): server_address = (conf.get(CONF_HOST), conf.get(CONF_PORT)) try: - _LOGGER.debug("Ebusd integration setup started") ebusdpy.init(server_address) hass.data[DOMAIN] = EbusdData(server_address, circuit) @@ -95,7 +91,6 @@ class EbusdData: self._address = address self.value = {} - @Throttle(MIN_TIME_BETWEEN_UPDATES) def update(self, name, stype): """Call the Ebusd API to update the data.""" try: diff --git a/homeassistant/components/ebusd/sensor.py b/homeassistant/components/ebusd/sensor.py index 63f72a89ccd..badb94a6f85 100644 --- a/homeassistant/components/ebusd/sensor.py +++ b/homeassistant/components/ebusd/sensor.py @@ -3,6 +3,7 @@ import datetime import logging from homeassistant.helpers.entity import Entity +from homeassistant.util import Throttle import homeassistant.util.dt as dt_util from .const import DOMAIN @@ -13,6 +14,7 @@ TIME_FRAME2_BEGIN = "time_frame2_begin" TIME_FRAME2_END = "time_frame2_end" TIME_FRAME3_BEGIN = "time_frame3_begin" TIME_FRAME3_END = "time_frame3_end" +MIN_TIME_BETWEEN_UPDATES = datetime.timedelta(seconds=15) _LOGGER = logging.getLogger(__name__) @@ -85,6 +87,7 @@ class EbusdSensor(Entity): """Return the unit of measurement.""" return self._unit_of_measurement + @Throttle(MIN_TIME_BETWEEN_UPDATES) def update(self): """Fetch new state data for the sensor.""" try: