mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
commit
3d9f03d4f1
@ -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']
|
||||
|
@ -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)
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user