Support longer-than-60-second scan_interval and interval_seconds (#5147)

* Update scan_interval and interval_seconds max to 1 day vs. 60 seconds

* Format fixes

* Add docstring on unittest.

* Added and implemented new async_track_time_interval helper.

* Format fixes, removed unused import.

* Undid whoops on unsub_polling.

* Updated unit tests for scan_interval.

* Added unit test for track_time_interval.

* Allow other forms of time interval input for scan_interval and interval_seconds
This commit is contained in:
Nick Touran 2017-01-05 14:05:16 -08:00 committed by Paulus Schoutsen
parent f88b5a9c5e
commit a36ca62445
6 changed files with 81 additions and 16 deletions

View file

@ -405,8 +405,7 @@ def key_dependency(key, dependency):
PLATFORM_SCHEMA = vol.Schema({
vol.Required(CONF_PLATFORM): string,
vol.Optional(CONF_SCAN_INTERVAL):
vol.All(vol.Coerce(int), vol.Range(min=1)),
vol.Optional(CONF_SCAN_INTERVAL): time_period
}, extra=vol.ALLOW_EXTRA)
EVENT_SCHEMA = vol.Schema({