Merge pull request #22265 from home-assistant/rc

0.90.1
This commit is contained in:
Paulus Schoutsen
2019-03-21 14:24:28 -07:00
committed by GitHub
13 changed files with 79 additions and 20 deletions

View File

@@ -18,7 +18,7 @@ from homeassistant.const import (
STATE_ALARM_ARMED_CUSTOM_BYPASS) STATE_ALARM_ARMED_CUSTOM_BYPASS)
REQUIREMENTS = ['total_connect_client==0.24'] REQUIREMENTS = ['total_connect_client==0.25']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@@ -24,7 +24,7 @@ from .const import (
CONF_USER_POOL_ID, DOMAIN, MODE_DEV, MODE_PROD) CONF_USER_POOL_ID, DOMAIN, MODE_DEV, MODE_PROD)
from .prefs import CloudPreferences from .prefs import CloudPreferences
REQUIREMENTS = ['hass-nabucasa==0.8'] REQUIREMENTS = ['hass-nabucasa==0.10']
DEPENDENCIES = ['http'] DEPENDENCIES = ['http']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@@ -21,7 +21,7 @@ from homeassistant.loader import bind_hass
from .storage import async_setup_frontend_storage from .storage import async_setup_frontend_storage
REQUIREMENTS = ['home-assistant-frontend==20190320.0'] REQUIREMENTS = ['home-assistant-frontend==20190321.0']
DOMAIN = 'frontend' DOMAIN = 'frontend'
DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log', DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log',

View File

@@ -65,6 +65,8 @@ def validate_webhook_requirements(hass: HomeAssistantType) -> bool:
"""Ensure HASS is setup properly to receive webhooks.""" """Ensure HASS is setup properly to receive webhooks."""
if cloud.async_active_subscription(hass): if cloud.async_active_subscription(hass):
return True return True
if hass.data[DOMAIN][CONF_CLOUDHOOK_URL] is not None:
return True
return get_webhook_url(hass).lower().startswith('https://') return get_webhook_url(hass).lower().startswith('https://')

View File

@@ -63,21 +63,29 @@ def stream_worker(hass, stream, quit_event):
first_packet = True first_packet = True
sequence = 1 sequence = 1
audio_packets = {} audio_packets = {}
last_dts = None
while not quit_event.is_set(): while not quit_event.is_set():
try: try:
packet = next(container.demux(video_stream)) packet = next(container.demux(video_stream))
if packet.dts is None: if packet.dts is None:
if first_packet:
continue
# If we get a "flushing" packet, the stream is done # If we get a "flushing" packet, the stream is done
raise StopIteration raise StopIteration("No dts in packet")
except (av.AVError, StopIteration) as ex: except (av.AVError, StopIteration) as ex:
# End of stream, clear listeners and stop thread # End of stream, clear listeners and stop thread
for fmt, _ in outputs.items(): for fmt, _ in outputs.items():
hass.loop.call_soon_threadsafe( hass.loop.call_soon_threadsafe(
stream.outputs[fmt].put, None) stream.outputs[fmt].put, None)
_LOGGER.error("Error demuxing stream: %s", ex) _LOGGER.error("Error demuxing stream: %s", str(ex))
break break
# Skip non monotonically increasing dts in feed
if not first_packet and last_dts >= packet.dts:
continue
last_dts = packet.dts
# Reset segment on every keyframe # Reset segment on every keyframe
if packet.is_keyframe: if packet.is_keyframe:
# Save segment to outputs # Save segment to outputs

View File

@@ -10,7 +10,7 @@ from homeassistant.helpers import config_validation as cv
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD from homeassistant.const import CONF_USERNAME, CONF_PASSWORD
from homeassistant.util import Throttle from homeassistant.util import Throttle
REQUIREMENTS = ['python-tado==0.2.8'] REQUIREMENTS = ['python-tado==0.2.9']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@@ -1,12 +1,12 @@
"""Support for Tado to create a climate device for each zone.""" """Support for Tado to create a climate device for each zone."""
import logging import logging
from homeassistant.const import (PRECISION_TENTHS, TEMP_CELSIUS)
from homeassistant.components.climate import ClimateDevice from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import ( from homeassistant.components.climate.const import (
SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE) SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE, SUPPORT_ON_OFF)
from homeassistant.const import (
ATTR_TEMPERATURE, PRECISION_TENTHS, TEMP_CELSIUS)
from homeassistant.util.temperature import convert as convert_temperature from homeassistant.util.temperature import convert as convert_temperature
from homeassistant.const import ATTR_TEMPERATURE
from homeassistant.components.tado import DATA_TADO from homeassistant.components.tado import DATA_TADO
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -41,7 +41,8 @@ OPERATION_LIST = {
CONST_MODE_OFF: 'Off', CONST_MODE_OFF: 'Off',
} }
SUPPORT_FLAGS = SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE SUPPORT_FLAGS = (SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE |
SUPPORT_ON_OFF)
def setup_platform(hass, config, add_entities, discovery_info=None): def setup_platform(hass, config, add_entities, discovery_info=None):
@@ -199,6 +200,27 @@ class TadoClimate(ClimateDevice):
"""Return the temperature we try to reach.""" """Return the temperature we try to reach."""
return self._target_temp return self._target_temp
@property
def is_on(self):
"""Return true if heater is on."""
return self._device_is_active
def turn_off(self):
"""Turn device off."""
_LOGGER.info("Switching mytado.com to OFF for zone %s",
self.zone_name)
self._current_operation = CONST_MODE_OFF
self._control_heating()
def turn_on(self):
"""Turn device on."""
_LOGGER.info("Switching mytado.com to %s mode for zone %s",
self._overlay_mode, self.zone_name)
self._current_operation = self._overlay_mode
self._control_heating()
def set_temperature(self, **kwargs): def set_temperature(self, **kwargs):
"""Set new target temperature.""" """Set new target temperature."""
temperature = kwargs.get(ATTR_TEMPERATURE) temperature = kwargs.get(ATTR_TEMPERATURE)

View File

@@ -52,9 +52,9 @@ class TadoDeviceScanner(DeviceScanner):
# If there's a home_id, we need a different API URL # If there's a home_id, we need a different API URL
if self.home_id is None: if self.home_id is None:
self.tadoapiurl = 'https://auth.tado.com/api/v2/me' self.tadoapiurl = 'https://my.tado.com/api/v2/me'
else: else:
self.tadoapiurl = 'https://auth.tado.com/api/v2' \ self.tadoapiurl = 'https://my.tado.com/api/v2' \
'/homes/{home_id}/mobileDevices' '/homes/{home_id}/mobileDevices'
# The API URL always needs a username and password # The API URL always needs a username and password

View File

@@ -179,7 +179,7 @@ class ZhaEntity(RestoreEntity, entity.Entity):
async def async_update(self): async def async_update(self):
"""Retrieve latest state.""" """Retrieve latest state."""
for channel in self.cluster_channels: for channel in self.cluster_channels.values():
if hasattr(channel, 'async_update'): if hasattr(channel, 'async_update'):
await channel.async_update() await channel.async_update()

View File

@@ -2,7 +2,7 @@
"""Constants used by Home Assistant components.""" """Constants used by Home Assistant components."""
MAJOR_VERSION = 0 MAJOR_VERSION = 0
MINOR_VERSION = 90 MINOR_VERSION = 90
PATCH_VERSION = '0' PATCH_VERSION = '1'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 5, 3) REQUIRED_PYTHON_VER = (3, 5, 3)

View File

@@ -524,7 +524,7 @@ habitipy==0.2.0
hangups==0.4.6 hangups==0.4.6
# homeassistant.components.cloud # homeassistant.components.cloud
hass-nabucasa==0.8 hass-nabucasa==0.10
# homeassistant.components.mqtt.server # homeassistant.components.mqtt.server
hbmqtt==0.9.4 hbmqtt==0.9.4
@@ -554,7 +554,7 @@ hole==0.3.0
holidays==0.9.9 holidays==0.9.9
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20190320.0 home-assistant-frontend==20190321.0
# homeassistant.components.zwave # homeassistant.components.zwave
homeassistant-pyozw==0.1.2 homeassistant-pyozw==0.1.2
@@ -1394,7 +1394,7 @@ python-songpal==0.0.9.1
python-synology==0.2.0 python-synology==0.2.0
# homeassistant.components.tado # homeassistant.components.tado
python-tado==0.2.8 python-tado==0.2.9
# homeassistant.components.telegram_bot # homeassistant.components.telegram_bot
python-telegram-bot==11.1.0 python-telegram-bot==11.1.0
@@ -1710,7 +1710,7 @@ todoist-python==7.0.17
toonapilib==3.2.2 toonapilib==3.2.2
# homeassistant.components.alarm_control_panel.totalconnect # homeassistant.components.alarm_control_panel.totalconnect
total_connect_client==0.24 total_connect_client==0.25
# homeassistant.components.tplink_lte # homeassistant.components.tplink_lte
tp-connected==0.0.4 tp-connected==0.0.4

View File

@@ -114,7 +114,7 @@ ha-ffmpeg==1.11
hangups==0.4.6 hangups==0.4.6
# homeassistant.components.cloud # homeassistant.components.cloud
hass-nabucasa==0.8 hass-nabucasa==0.10
# homeassistant.components.mqtt.server # homeassistant.components.mqtt.server
hbmqtt==0.9.4 hbmqtt==0.9.4
@@ -126,7 +126,7 @@ hdate==0.8.7
holidays==0.9.9 holidays==0.9.9
# homeassistant.components.frontend # homeassistant.components.frontend
home-assistant-frontend==20190320.0 home-assistant-frontend==20190321.0
# homeassistant.components.homekit_controller # homeassistant.components.homekit_controller
homekit[IP]==0.13.0 homekit[IP]==0.13.0

View File

@@ -189,6 +189,33 @@ async def test_config_entry_loads_platforms(
assert forward_mock.call_count == len(SUPPORTED_PLATFORMS) assert forward_mock.call_count == len(SUPPORTED_PLATFORMS)
async def test_config_entry_loads_unconnected_cloud(
hass, config_entry, app, installed_app,
device, smartthings_mock, subscription_factory, scene):
"""Test entry loads during startup when cloud isn't connected."""
setattr(hass.config_entries, '_entries', [config_entry])
hass.data[DOMAIN][CONF_CLOUDHOOK_URL] = "https://test.cloud"
hass.config.api.base_url = 'http://0.0.0.0'
api = smartthings_mock.return_value
api.app.return_value = mock_coro(return_value=app)
api.installed_app.return_value = mock_coro(return_value=installed_app)
api.devices.side_effect = \
lambda *args, **kwargs: mock_coro(return_value=[device])
api.scenes.return_value = mock_coro(return_value=[scene])
mock_token = Mock()
mock_token.access_token.return_value = str(uuid4())
mock_token.refresh_token.return_value = str(uuid4())
api.generate_tokens.return_value = mock_coro(return_value=mock_token)
subscriptions = [subscription_factory(capability)
for capability in device.capabilities]
api.subscriptions.return_value = mock_coro(return_value=subscriptions)
with patch.object(hass.config_entries, 'async_forward_entry_setup',
return_value=mock_coro()) as forward_mock:
assert await smartthings.async_setup_entry(hass, config_entry)
await hass.async_block_till_done()
assert forward_mock.call_count == len(SUPPORTED_PLATFORMS)
async def test_unload_entry(hass, config_entry): async def test_unload_entry(hass, config_entry):
"""Test entries are unloaded correctly.""" """Test entries are unloaded correctly."""
connect_disconnect = Mock() connect_disconnect = Mock()