Make forecast.io update interval configurable (#3520)
Adds a config parameter (`update_interval`) to the `forecast` sensor to set the minimum update interval. The default remains 120 seconds.
This commit is contained in:
1 parent
1f38e9fa57
commit
9da2d6edd0
2 files changed
+26
-17
No files matched your search
@@ -6,6 +6,7 @@ from unittest.mock import MagicMock, patch
|
||||
import forecastio
|
||||
from requests.exceptions import HTTPError
|
||||
import requests_mock
|
||||
from datetime import timedelta
|
||||
|
||||
from homeassistant.components.sensor import forecast
|
||||
|
||||
@@ -21,7 +22,8 @@ class TestForecastSetup(unittest.TestCase):
|
||||
self.key = 'foo'
|
||||
self.config = {
|
||||
'api_key': 'foo',
|
||||
'monitored_conditions': ['summary', 'icon']
|
||||
'monitored_conditions': ['summary', 'icon'],
|
||||
'update_interval': timedelta(seconds=120),
|
||||
}
|
||||
self.lat = 37.8267
|
||||
self.lon = -122.423
|
||||
|
||||
Reference in new issue
Block a user