Bugfix default values to timedelta (#5193)

* Bugfix default values to timedelta

* fix unittests
This commit is contained in:
Pascal Vizeli authored and GitHub committed 2017-01-06 00:16:12 +01:00
1 parent c959637ebe
commit 1719d88602
20 files changed
+44 -36

No files matched your search

+2 -1
View File
@@ -5,13 +5,14 @@ For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor/
"""
import asyncio
from datetime import timedelta
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa
DOMAIN = 'sensor'
SCAN_INTERVAL = 30
SCAN_INTERVAL = timedelta(seconds=30)
ENTITY_ID_FORMAT = DOMAIN + '.{}'
@@ -4,6 +4,7 @@ Allows to configure custom shell commands to turn a value for a sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.command_line/
"""
from datetime import timedelta
import logging
import subprocess
@@ -20,7 +21,7 @@ _LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'Command Sensor'
SCAN_INTERVAL = 60
SCAN_INTERVAL = timedelta(seconds=60)
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_COMMAND): cv.string,
@@ -4,6 +4,7 @@ Monitors home energy use for the ELIQ Online service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.eliqonline/
"""
from datetime import timedelta
import logging
from urllib.error import URLError
@@ -24,7 +25,7 @@ DEFAULT_NAME = 'ELIQ Online'
ICON = 'mdi:speedometer'
SCAN_INTERVAL = 60
SCAN_INTERVAL = timedelta(seconds=60)
UNIT_OF_MEASUREMENT = 'W'