Skip to content

Commit

Permalink
Merge pull request #10716 from home-assistant/release-0-58-1
Browse files Browse the repository at this point in the history
0.58.1
  • Loading branch information
balloob authored Nov 21, 2017
2 parents d9a6d9e + 235707d commit 3d9f03d
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
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']
Expand Down
1 change: 1 addition & 0 deletions homeassistant/components/remote/harmony.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions homeassistant/components/sensor/hydroquebec.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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__)

Expand All @@ -34,6 +34,7 @@

REQUESTS_TIMEOUT = 15
MIN_TIME_BETWEEN_UPDATES = timedelta(hours=1)
SCAN_INTERVAL = timedelta(hours=1)

SENSOR_TYPES = {
'balance':
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/sensor/time_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def get_next_interval(self, now=None):
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
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/weather/yweather.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def condition(self):
@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):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 22 additions & 5 deletions tests/components/sensor/test_time_date.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -36,11 +37,6 @@ def test_intervals(self):
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)
Expand Down Expand Up @@ -89,6 +85,27 @@ def test_timezone_intervals(self):
# 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')
Expand Down

0 comments on commit 3d9f03d

Please sign in to comment.