diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index e7cfcf8d88c..3d83c524461 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -23,7 +23,7 @@ from homeassistant.const import CONF_NAME, EVENT_THEMES_UPDATED from homeassistant.core import callback from homeassistant.loader import bind_hass -REQUIREMENTS = ['home-assistant-frontend==20171118.0'] +REQUIREMENTS = ['home-assistant-frontend==20171121.0'] DOMAIN = 'frontend' DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log'] diff --git a/homeassistant/components/remote/harmony.py b/homeassistant/components/remote/harmony.py index 7a398def5f9..40536a83602 100755 --- a/homeassistant/components/remote/harmony.py +++ b/homeassistant/components/remote/harmony.py @@ -60,6 +60,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): False) port = DEFAULT_PORT + delay_secs = DEFAULT_DELAY_SECS if override: activity = override.get(ATTR_ACTIVITY) delay_secs = override.get(ATTR_DELAY_SECS) diff --git a/homeassistant/components/sensor/hydroquebec.py b/homeassistant/components/sensor/hydroquebec.py index 884f101c033..d857ce57fce 100644 --- a/homeassistant/components/sensor/hydroquebec.py +++ b/homeassistant/components/sensor/hydroquebec.py @@ -21,7 +21,7 @@ from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['pyhydroquebec==1.2.0'] +REQUIREMENTS = ['pyhydroquebec==1.3.1'] _LOGGER = logging.getLogger(__name__) @@ -34,6 +34,7 @@ DEFAULT_NAME = 'HydroQuebec' REQUESTS_TIMEOUT = 15 MIN_TIME_BETWEEN_UPDATES = timedelta(hours=1) +SCAN_INTERVAL = timedelta(hours=1) SENSOR_TYPES = { 'balance': @@ -115,7 +116,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): for variable in config[CONF_MONITORED_VARIABLES]: sensors.append(HydroQuebecSensor(hydroquebec_data, variable, name)) - add_devices(sensors, True) + add_devices(sensors) class HydroQuebecSensor(Entity): diff --git a/homeassistant/components/sensor/time_date.py b/homeassistant/components/sensor/time_date.py index 69723aea19a..bfdf0c3c3aa 100644 --- a/homeassistant/components/sensor/time_date.py +++ b/homeassistant/components/sensor/time_date.py @@ -90,7 +90,7 @@ class TimeDateSensor(Entity): if now is None: now = dt_util.utcnow() if self.type == 'date': - now = dt_util.start_of_local_day(now) + now = dt_util.start_of_local_day(dt_util.as_local(now)) return now + timedelta(seconds=86400) elif self.type == 'beat': interval = 86.4 diff --git a/homeassistant/components/weather/yweather.py b/homeassistant/components/weather/yweather.py index 514eda0f09f..a043f3c2212 100644 --- a/homeassistant/components/weather/yweather.py +++ b/homeassistant/components/weather/yweather.py @@ -115,7 +115,7 @@ class YahooWeatherWeather(WeatherEntity): @property def temperature(self): """Return the temperature.""" - return self._data.yahoo.Now['temp'] + return int(self._data.yahoo.Now['temp']) @property def temperature_unit(self): diff --git a/homeassistant/const.py b/homeassistant/const.py index d8b4dfcb044..706a3881831 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 58 -PATCH_VERSION = '0' +PATCH_VERSION = '1' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 4, 2) diff --git a/requirements_all.txt b/requirements_all.txt index 405bafaf13a..4ce91ce57a7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -331,7 +331,7 @@ hipnotify==1.0.8 holidays==0.8.1 # homeassistant.components.frontend -home-assistant-frontend==20171118.0 +home-assistant-frontend==20171121.0 # homeassistant.components.camera.onvif http://github.com/tgaugry/suds-passworddigest-py3/archive/86fc50e39b4d2b8997481967d6a7fe1c57118999.zip#suds-passworddigest-py3==0.1.2a @@ -676,7 +676,7 @@ pyhik==0.1.4 pyhomematic==0.1.34 # homeassistant.components.sensor.hydroquebec -pyhydroquebec==1.2.0 +pyhydroquebec==1.3.1 # homeassistant.components.device_tracker.icloud pyicloud==0.9.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index c9ea20494d4..ac39aef6e47 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -74,7 +74,7 @@ hbmqtt==0.9.1 holidays==0.8.1 # homeassistant.components.frontend -home-assistant-frontend==20171118.0 +home-assistant-frontend==20171121.0 # homeassistant.components.influxdb # homeassistant.components.sensor.influxdb diff --git a/tests/components/sensor/test_time_date.py b/tests/components/sensor/test_time_date.py index 98eb6e79428..1b3ab68988e 100644 --- a/tests/components/sensor/test_time_date.py +++ b/tests/components/sensor/test_time_date.py @@ -1,5 +1,6 @@ """The tests for Kira sensor platform.""" import unittest +from unittest.mock import patch from homeassistant.components.sensor import time_date as time_date import homeassistant.util.dt as dt_util @@ -36,11 +37,6 @@ class TestTimeDateSensor(unittest.TestCase): next_time = device.get_next_interval(now) assert next_time == dt_util.utc_from_timestamp(60) - device = time_date.TimeDateSensor(self.hass, 'date') - now = dt_util.utc_from_timestamp(12345) - next_time = device.get_next_interval(now) - assert next_time == dt_util.utc_from_timestamp(86400) - device = time_date.TimeDateSensor(self.hass, 'beat') now = dt_util.utc_from_timestamp(29) next_time = device.get_next_interval(now) @@ -89,6 +85,27 @@ class TestTimeDateSensor(unittest.TestCase): # so the second day was 18000 + 86400 assert next_time.timestamp() == 104400 + new_tz = dt_util.get_time_zone('America/Edmonton') + assert new_tz is not None + dt_util.set_default_time_zone(new_tz) + now = dt_util.parse_datetime('2017-11-13 19:47:19-07:00') + device = time_date.TimeDateSensor(self.hass, 'date') + next_time = device.get_next_interval(now) + assert (next_time.timestamp() == + dt_util.as_timestamp('2017-11-14 00:00:00-07:00')) + + @patch('homeassistant.util.dt.utcnow', + return_value=dt_util.parse_datetime('2017-11-14 02:47:19-00:00')) + def test_timezone_intervals_empty_parameter(self, _): + """Test get_interval() without parameters.""" + new_tz = dt_util.get_time_zone('America/Edmonton') + assert new_tz is not None + dt_util.set_default_time_zone(new_tz) + device = time_date.TimeDateSensor(self.hass, 'date') + next_time = device.get_next_interval() + assert (next_time.timestamp() == + dt_util.as_timestamp('2017-11-14 00:00:00-07:00')) + def test_icons(self): """Test attributes of sensors.""" device = time_date.TimeDateSensor(self.hass, 'time')