Merge pull request #8980 from home-assistant/release-0-51-2

0.51.2
This commit is contained in:
Paulus Schoutsen 2017-08-13 22:18:05 -07:00 committed by GitHub
commit 8d661f8dea
14 changed files with 82 additions and 32 deletions

View File

@ -56,7 +56,7 @@ class FoscamCam(Camera):
from foscam import FoscamCamera
self._foscam_session = FoscamCamera(ip_address, port, self._username,
self._password)
self._password, verbose=False)
def camera_image(self):
"""Return a still image reponse from the camera."""

View File

@ -3,7 +3,7 @@
FINGERPRINTS = {
"compatibility.js": "1686167ff210e001f063f5c606b2e74b",
"core.js": "2a7d01e45187c7d4635da05065b5e54e",
"frontend.html": "fb225cfababf965f8e19a8eb5c5a2a7e",
"frontend.html": "5a2a3d6181cc820f5b3e94d1a50def74",
"mdi.html": "e91f61a039ed0a9936e7ee5360da3870",
"micromarkdown-js.html": "93b5ec4016f0bba585521cf4d18dec1a",
"panels/ha-panel-config.html": "ec48185c79000d0cfe5bbf38c7974944",

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit 823a6996708d5b85097fb1db0defbc03516e77bf
Subproject commit 34e45427ea2ee4f3d1a439db9fb5b8e3368f40d9

View File

@ -37,7 +37,7 @@
/* eslint-disable indent, no-unused-vars, no-multiple-empty-lines, max-nested-callbacks, space-before-function-paren, quotes, comma-spacing */
'use strict';
var precacheConfig = [["/","ac95485aa7eafc661d515253bbba1b6d"],["/frontend/panels/dev-event-d409e7ab537d9fe629126d122345279c.html","936814991f2a5e23d61d29f0d40f81b8"],["/frontend/panels/dev-info-b0e55eb657fd75f21aba2426ac0cedc0.html","1fa953b0224470f70d4e87bbe4dff191"],["/frontend/panels/dev-mqtt-94b222b013a98583842de3e72d5888c6.html","dc3ddfac58397feda97317358f0aecbb"],["/frontend/panels/dev-service-422b2c181ee0713fa31d45a64e605baf.html","ae7d26b1c8c3309fd3c65944f89ea03f"],["/frontend/panels/dev-state-7948d3dba058f31517d880df8ed0e857.html","ff8156bb1a52490fcc07466556fce0e1"],["/frontend/panels/dev-template-f47b6910d8e4880e22cc508ca452f9b6.html","9aa0675e01373c6bc2737438bb84a9ec"],["/frontend/panels/map-c2544fff3eedb487d44105cf94b335ec.html","113c5bf9a68a74c62e50cd354034e78b"],["/static/compatibility-1686167ff210e001f063f5c606b2e74b.js","6ee7b5e2dd82b510c3bd92f7e215988e"],["/static/core-2a7d01e45187c7d4635da05065b5e54e.js","90a0a8a6a6dd0ca41b16f40e7d23924d"],["/static/frontend-fb225cfababf965f8e19a8eb5c5a2a7e.html","429b61684b027ffe2a50de3d04dd3db6"],["/static/mdi-e91f61a039ed0a9936e7ee5360da3870.html","5e587bc82719b740a4f0798722a83aee"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/icons/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/icons/favicon.ico","04235bda7843ec2fceb1cbe2bc696cf4"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"]];
var precacheConfig = [["/","07ae53d16e9e97de8c721f5032cf79bf"],["/frontend/panels/dev-event-d409e7ab537d9fe629126d122345279c.html","936814991f2a5e23d61d29f0d40f81b8"],["/frontend/panels/dev-info-b0e55eb657fd75f21aba2426ac0cedc0.html","1fa953b0224470f70d4e87bbe4dff191"],["/frontend/panels/dev-mqtt-94b222b013a98583842de3e72d5888c6.html","dc3ddfac58397feda97317358f0aecbb"],["/frontend/panels/dev-service-422b2c181ee0713fa31d45a64e605baf.html","ae7d26b1c8c3309fd3c65944f89ea03f"],["/frontend/panels/dev-state-7948d3dba058f31517d880df8ed0e857.html","ff8156bb1a52490fcc07466556fce0e1"],["/frontend/panels/dev-template-f47b6910d8e4880e22cc508ca452f9b6.html","9aa0675e01373c6bc2737438bb84a9ec"],["/frontend/panels/map-c2544fff3eedb487d44105cf94b335ec.html","113c5bf9a68a74c62e50cd354034e78b"],["/static/compatibility-1686167ff210e001f063f5c606b2e74b.js","6ee7b5e2dd82b510c3bd92f7e215988e"],["/static/core-2a7d01e45187c7d4635da05065b5e54e.js","90a0a8a6a6dd0ca41b16f40e7d23924d"],["/static/frontend-5a2a3d6181cc820f5b3e94d1a50def74.html","6cd425233aeb180178dccae238533d65"],["/static/mdi-e91f61a039ed0a9936e7ee5360da3870.html","5e587bc82719b740a4f0798722a83aee"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/icons/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/icons/favicon.ico","04235bda7843ec2fceb1cbe2bc696cf4"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"]];
var cacheName = 'sw-precache-v3--' + (self.registration ? self.registration.scope : '');

View File

@ -91,7 +91,7 @@ class PushBulletNotificationService(BaseNotificationService):
# Backward compatibility, notify all devices in own account
if url:
self.pushbullet.push_link(title, url, body=message)
if self.hass.config.is_allowed_path(filepath):
if filepath and self.hass.config.is_allowed_path(filepath):
with open(filepath, "rb") as fileh:
filedata = self.pushbullet.upload_file(fileh, filepath)
self.pushbullet.push_file(title=title, body=message,
@ -115,7 +115,7 @@ class PushBulletNotificationService(BaseNotificationService):
if url:
self.pushbullet.push_link(
title, url, body=message, email=tname)
if self.hass.config.is_allowed_path(filepath):
if filepath and self.hass.config.is_allowed_path(filepath):
with open(filepath, "rb") as fileh:
filedata = self.pushbullet.upload_file(fileh, filepath)
self.pushbullet.push_file(title=title, body=message,

View File

@ -214,14 +214,15 @@ class HarmonyRemote(remote.RemoteDevice):
if device is None:
_LOGGER.error("Missing required argument: device")
return
params = {}
num_repeats = kwargs.pop(ATTR_NUM_REPEATS, None)
if num_repeats is not None:
kwargs[ATTR_NUM_REPEATS] = num_repeats
params['repeat_num'] = num_repeats
delay_secs = kwargs.pop(ATTR_DELAY_SECS, None)
if delay_secs is not None:
kwargs[ATTR_DELAY_SECS] = delay_secs
params['delay_secs'] = delay_secs
pyharmony.ha_send_commands(
self._token, self.host, self._port, device, command, **kwargs)
self._token, self.host, self._port, device, command, **params)
def sync(self):
"""Sync the Harmony device with the web service."""

View File

@ -130,15 +130,16 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
"""Set up the SABnzbd platform."""
from pysabnzbd import SabnzbdApi
host = config.get(CONF_HOST) or discovery_info.get(CONF_HOST)
port = config.get(CONF_PORT) or discovery_info.get(CONF_PORT)
if discovery_info is not None:
host = discovery_info.get(CONF_HOST)
port = discovery_info.get(CONF_PORT)
name = DEFAULT_NAME
use_ssl = discovery_info.get('properties', {}).get('https', '0') == '1'
else:
host = config.get(CONF_HOST)
port = config.get(CONF_PORT)
name = config.get(CONF_NAME, DEFAULT_NAME)
use_ssl = DEFAULT_SSL
if config.get(CONF_SSL):
use_ssl = True
elif discovery_info.get('properties', {}).get('https', '0') == '1':
use_ssl = True
use_ssl = config.get(CONF_SSL)
uri_scheme = 'https://' if use_ssl else 'http://'
base_url = "{}{}:{}/".format(uri_scheme, host, port)

View File

@ -219,12 +219,12 @@ class MiroboVacuum(VacuumDevice):
@asyncio.coroutine
def _try_command(self, mask_error, func, *args, **kwargs):
"""Call a vacuum command handling error messages."""
from mirobo import VacuumException
from mirobo import DeviceException, VacuumException
try:
yield from self.hass.async_add_job(partial(func, *args, **kwargs))
return True
except VacuumException as ex:
_LOGGER.error(mask_error, ex)
except (DeviceException, VacuumException) as exc:
_LOGGER.error(mask_error, exc)
return False
@asyncio.coroutine
@ -341,7 +341,7 @@ class MiroboVacuum(VacuumDevice):
@asyncio.coroutine
def async_update(self):
"""Fetch state from the device."""
from mirobo import VacuumException
from mirobo import DeviceException
try:
state = yield from self.hass.async_add_job(self._vacuum.status)
_LOGGER.debug("Got new state from the vacuum: %s", state.data)
@ -351,6 +351,6 @@ class MiroboVacuum(VacuumDevice):
except OSError as exc:
_LOGGER.error("Got OSError while fetching the state: %s", exc)
# self._available = False
except VacuumException as exc:
except DeviceException as exc:
_LOGGER.warning("Got exception while fetching the state: %s", exc)
# self._available = False

View File

@ -54,9 +54,12 @@ def check_value_schema(value, schema):
value.instance, schema[const.DISC_INSTANCE])
return False
if const.DISC_SCHEMAS in schema:
found = False
for schema_item in schema[const.DISC_SCHEMAS]:
if not check_value_schema(value, schema_item):
found = found or check_value_schema(value, schema_item)
if not found:
return False
return True

View File

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

View File

@ -3,6 +3,9 @@ import asyncio
from collections import OrderedDict
from datetime import datetime
import unittest
from unittest.mock import patch, MagicMock
from homeassistant.bootstrap import async_setup_component
from homeassistant.const import ATTR_ENTITY_ID, EVENT_HOMEASSISTANT_START
from homeassistant.components import zwave
@ -12,8 +15,6 @@ from homeassistant.components.zwave import (
from homeassistant.setup import setup_component
import pytest
import unittest
from unittest.mock import patch, MagicMock
from tests.common import (
get_test_home_assistant, async_fire_time_changed)
@ -312,6 +313,50 @@ def test_value_discovery_existing_entity(hass, mock_openzwave):
'current_temperature'] == 23.5
@asyncio.coroutine
def test_power_schemes(hass, mock_openzwave):
"""Test power attribute."""
mock_receivers = []
def mock_connect(receiver, signal, *args, **kwargs):
if signal == MockNetwork.SIGNAL_VALUE_ADDED:
mock_receivers.append(receiver)
with patch('pydispatch.dispatcher.connect', new=mock_connect):
yield from async_setup_component(hass, 'zwave', {'zwave': {
'new_entity_ids': True,
}})
assert len(mock_receivers) == 1
node = MockNode(node_id=11, generic=const.GENERIC_TYPE_SWITCH_BINARY)
switch = MockValue(
data=True, node=node, index=12, instance=13,
command_class=const.COMMAND_CLASS_SWITCH_BINARY,
genre=const.GENRE_USER, type=const.TYPE_BOOL)
hass.async_add_job(mock_receivers[0], node, switch)
yield from hass.async_block_till_done()
assert hass.states.get('switch.mock_node_mock_value').state == 'on'
assert 'power_consumption' not in hass.states.get(
'switch.mock_node_mock_value').attributes
def mock_update(self):
self.hass.async_add_job(self.async_update_ha_state)
with patch.object(zwave.node_entity.ZWaveBaseEntity,
'maybe_schedule_update', new=mock_update):
power = MockValue(
data=23.5, node=node, index=const.INDEX_SENSOR_MULTILEVEL_POWER,
instance=13, command_class=const.COMMAND_CLASS_SENSOR_MULTILEVEL)
hass.async_add_job(mock_receivers[0], node, power)
yield from hass.async_block_till_done()
assert hass.states.get('switch.mock_node_mock_value').attributes[
'power_consumption'] == 23.5
@asyncio.coroutine
def test_network_ready(hass, mock_openzwave):
"""Test Node network ready event."""