mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
parent
8a88af20da
commit
da61b18392
@ -15,6 +15,7 @@ from homeassistant.const import (
|
|||||||
TEMP_CELSIUS, CONF_MONITORED_CONDITIONS, CONF_NAME, STATE_UNKNOWN,
|
TEMP_CELSIUS, CONF_MONITORED_CONDITIONS, CONF_NAME, STATE_UNKNOWN,
|
||||||
ATTR_ATTRIBUTION)
|
ATTR_ATTRIBUTION)
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
REQUIREMENTS = ['yahooweather==0.8']
|
REQUIREMENTS = ['yahooweather==0.8']
|
||||||
|
|
||||||
@ -26,7 +27,7 @@ CONF_WOEID = 'woeid'
|
|||||||
|
|
||||||
DEFAULT_NAME = 'Yweather'
|
DEFAULT_NAME = 'Yweather'
|
||||||
|
|
||||||
SCAN_INTERVAL = timedelta(minutes=10)
|
MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=10)
|
||||||
|
|
||||||
SENSOR_TYPES = {
|
SENSOR_TYPES = {
|
||||||
'weather_current': ['Current', None],
|
'weather_current': ['Current', None],
|
||||||
@ -181,6 +182,7 @@ class YahooWeatherData(object):
|
|||||||
"""Return Yahoo! API object."""
|
"""Return Yahoo! API object."""
|
||||||
return self._yahoo
|
return self._yahoo
|
||||||
|
|
||||||
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Get the latest data from Yahoo!."""
|
"""Get the latest data from Yahoo!."""
|
||||||
return self._yahoo.updateWeather()
|
return self._yahoo.updateWeather()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user