Bugfix for ping component now DEFAULT_SCAN_INTERVAL is a timedelta (#5318)

This commit is contained in:
Michaël Arnauts 2017-01-14 11:55:29 +01:00 committed by Pascal Vizeli
parent b817c7d0c2
commit c3783bf49b

View File

@ -77,8 +77,8 @@ def setup_scanner(hass, config, see):
"""Setup the Host objects and return the update function."""
hosts = [Host(ip, dev_id, hass, config) for (dev_id, ip) in
config[const.CONF_HOSTS].items()]
interval = timedelta(seconds=len(hosts) * config[CONF_PING_COUNT] +
DEFAULT_SCAN_INTERVAL)
interval = timedelta(seconds=len(hosts) * config[CONF_PING_COUNT]) + \
DEFAULT_SCAN_INTERVAL
_LOGGER.info("Started ping tracker with interval=%s on hosts: %s",
interval, ",".join([host.ip_address for host in hosts]))