From 9bf824bf00004c19718ca75f1be6a8ff67073af5 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 3 Nov 2018 13:48:45 +0100 Subject: [PATCH 01/39] Bumped version to 0.82.0b0 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index ffbba575a14..bb14259ce0d 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 82 -PATCH_VERSION = '0.dev0' +PATCH_VERSION = '0b0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 461e6acf5cfb491ca5efbce8b7b9fc70ef4e1bd3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 3 Nov 2018 19:18:20 +0100 Subject: [PATCH 02/39] Bump frontend to 20181103.1 --- homeassistant/components/frontend/__init__.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index 108dcf74d9f..450daf5eb4c 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -24,7 +24,7 @@ from homeassistant.core import callback from homeassistant.helpers.translation import async_get_translations from homeassistant.loader import bind_hass -REQUIREMENTS = ['home-assistant-frontend==20181103.0'] +REQUIREMENTS = ['home-assistant-frontend==20181103.1'] DOMAIN = 'frontend' DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log', diff --git a/requirements_all.txt b/requirements_all.txt index 22221a57e28..a6524fee2d7 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -476,7 +476,7 @@ hole==0.3.0 holidays==0.9.8 # homeassistant.components.frontend -home-assistant-frontend==20181103.0 +home-assistant-frontend==20181103.1 # homeassistant.components.homekit_controller # homekit==0.10 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 91219023f9c..75e21b33c38 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -97,7 +97,7 @@ hdate==0.6.5 holidays==0.9.8 # homeassistant.components.frontend -home-assistant-frontend==20181103.0 +home-assistant-frontend==20181103.1 # homeassistant.components.homematicip_cloud homematicip==0.9.8 From b2bdf05caecbecadf27aa06aabc5002161c7518c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 3 Nov 2018 19:18:38 +0100 Subject: [PATCH 03/39] Bumped version to 0.82.0b1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index bb14259ce0d..2e0ef79d8f8 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 82 -PATCH_VERSION = '0b0' +PATCH_VERSION = '0b1' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 3abe49bacee6803e561b0abb16d512cb60e2c683 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 4 Nov 2018 12:19:04 +0100 Subject: [PATCH 04/39] Bugfix discovery (delete/mqtt) call for Hass.io (#18159) * Bugfix discovery delete call for Hass.io * Fix host * fix tests --- homeassistant/components/hassio/discovery.py | 2 +- homeassistant/components/mqtt/config_flow.py | 6 +++--- tests/components/mqtt/test_config_flow.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/hassio/discovery.py b/homeassistant/components/hassio/discovery.py index 4c7c5a6597f..a5f62b9e1a1 100644 --- a/homeassistant/components/hassio/discovery.py +++ b/homeassistant/components/hassio/discovery.py @@ -71,7 +71,7 @@ class HassIODiscovery(HomeAssistantView): async def delete(self, request, uuid): """Handle remove discovery requests.""" - data = request.json() + data = await request.json() await self.async_process_del(data) return web.Response() diff --git a/homeassistant/components/mqtt/config_flow.py b/homeassistant/components/mqtt/config_flow.py index e0d1e692c60..aee825d06de 100644 --- a/homeassistant/components/mqtt/config_flow.py +++ b/homeassistant/components/mqtt/config_flow.py @@ -6,7 +6,7 @@ import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ( - CONF_PASSWORD, CONF_PORT, CONF_USERNAME, CONF_PROTOCOL) + CONF_PASSWORD, CONF_PORT, CONF_USERNAME, CONF_PROTOCOL, CONF_HOST) from .const import CONF_BROKER, CONF_DISCOVERY, DEFAULT_DISCOVERY @@ -80,7 +80,7 @@ class FlowHandler(config_entries.ConfigFlow): data = self._hassio_discovery can_connect = await self.hass.async_add_executor_job( try_connection, - data[CONF_BROKER], + data[CONF_HOST], data[CONF_PORT], data.get(CONF_USERNAME), data.get(CONF_PASSWORD), @@ -90,7 +90,7 @@ class FlowHandler(config_entries.ConfigFlow): if can_connect: return self.async_create_entry( title=data['addon'], data={ - CONF_BROKER: data[CONF_BROKER], + CONF_BROKER: data[CONF_HOST], CONF_PORT: data[CONF_PORT], CONF_USERNAME: data.get(CONF_USERNAME), CONF_PASSWORD: data.get(CONF_PASSWORD), diff --git a/tests/components/mqtt/test_config_flow.py b/tests/components/mqtt/test_config_flow.py index 08bb4e54a39..66bf9b97807 100644 --- a/tests/components/mqtt/test_config_flow.py +++ b/tests/components/mqtt/test_config_flow.py @@ -119,7 +119,7 @@ async def test_hassio_confirm(hass, mock_try_connection, 'mqtt', data={ 'addon': 'Mock Addon', - 'broker': 'mock-broker', + 'host': 'mock-broker', 'port': 1883, 'username': 'mock-user', 'password': 'mock-pass', From 075169a7a91701d958f9cf24db9491b26cf159bf Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 4 Nov 2018 13:20:25 +0100 Subject: [PATCH 05/39] Bumped version to 0.81.6 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 66153dcaf46..8d37a48c0a3 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 81 -PATCH_VERSION = '5' +PATCH_VERSION = '6' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From dbf6b01a603aca5b7cd7d1e8281cd1286eb8206a Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Sun, 4 Nov 2018 19:09:14 +0200 Subject: [PATCH 06/39] SMA: Optional import in schema & backoff fix (#18099) --- homeassistant/components/sensor/sma.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sensor/sma.py b/homeassistant/components/sensor/sma.py index 4b0c33191dc..3f17b4971ec 100644 --- a/homeassistant/components/sensor/sma.py +++ b/homeassistant/components/sensor/sma.py @@ -35,7 +35,10 @@ GROUPS = ['user', 'installer'] def _check_sensor_schema(conf): """Check sensors and attributes are valid.""" - import pysma + try: + import pysma + except ImportError: + return conf valid = list(conf[CONF_CUSTOM].keys()) valid.extend([s.name for s in pysma.SENSORS]) @@ -73,6 +76,9 @@ async def async_setup_platform( """Set up SMA WebConnect sensor.""" import pysma + # Check config again during load - dependency available + config = _check_sensor_schema(config) + # Sensor_defs from the custom config for name, prop in config[CONF_CUSTOM].items(): n_s = pysma.Sensor(name, prop['key'], prop['unit'], prop['factor']) @@ -107,18 +113,24 @@ async def async_setup_platform( hass.bus.async_listen(EVENT_HOMEASSISTANT_STOP, async_close_session) backoff = 0 + backoff_step = 0 async def async_sma(event): """Update all the SMA sensors.""" - nonlocal backoff + nonlocal backoff, backoff_step if backoff > 1: backoff -= 1 return values = await sma.read(used_sensors) - if values is None: - backoff = 10 + if not values: + try: + backoff = [1, 1, 1, 6, 30][backoff_step] + backoff_step += 1 + except IndexError: + backoff = 60 return + backoff_step = 0 tasks = [] for sensor in hass_sensors: From 31737c5100a371b25201cde2bd19a288156e533c Mon Sep 17 00:00:00 2001 From: jjlawren Date: Sun, 4 Nov 2018 08:20:32 -0600 Subject: [PATCH 07/39] Remove config (breaking change) (#18153) --- homeassistant/components/ffmpeg.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/homeassistant/components/ffmpeg.py b/homeassistant/components/ffmpeg.py index 791f6d29175..a2f0ca19231 100644 --- a/homeassistant/components/ffmpeg.py +++ b/homeassistant/components/ffmpeg.py @@ -37,14 +37,12 @@ CONF_INPUT = 'input' CONF_FFMPEG_BIN = 'ffmpeg_bin' CONF_EXTRA_ARGUMENTS = 'extra_arguments' CONF_OUTPUT = 'output' -CONF_RUN_TEST = 'run_test' DEFAULT_BINARY = 'ffmpeg' CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Optional(CONF_FFMPEG_BIN, default=DEFAULT_BINARY): cv.string, - vol.Optional(CONF_RUN_TEST): cv.boolean, }), }, extra=vol.ALLOW_EXTRA) From b3bd59efb00d90e13d2c52adb611436586d977d0 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 4 Nov 2018 15:15:14 +0100 Subject: [PATCH 08/39] Handle TensorFlow like OpenCV (#18185) * Handle TensorFlow like OpenCV * Update requirements_all.txt --- homeassistant/components/image_processing/tensorflow.py | 3 +-- requirements_all.txt | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/homeassistant/components/image_processing/tensorflow.py b/homeassistant/components/image_processing/tensorflow.py index f333aa1767c..a2cd997bb76 100644 --- a/homeassistant/components/image_processing/tensorflow.py +++ b/homeassistant/components/image_processing/tensorflow.py @@ -20,8 +20,7 @@ from homeassistant.core import split_entity_id from homeassistant.helpers import template import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['numpy==1.15.3', 'pillow==5.2.0', - 'protobuf==3.6.1', 'tensorflow==1.11.0'] +REQUIREMENTS = ['numpy==1.15.3', 'pillow==5.2.0', 'protobuf==3.6.1'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index a6524fee2d7..48673ee31ca 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1469,9 +1469,6 @@ temescal==0.1 # homeassistant.components.sensor.temper temperusb==1.5.3 -# homeassistant.components.image_processing.tensorflow -tensorflow==1.11.0 - # homeassistant.components.tesla teslajsonpy==0.0.23 From de79c42b8a099424406223599722781c4ab2c0ea Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 4 Nov 2018 15:19:48 +0100 Subject: [PATCH 09/39] Add support for TensorFlow in official docker (#18191) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 92b85c29325..4cd4f3e8871 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,7 +28,7 @@ COPY requirements_all.txt requirements_all.txt # Uninstall enum34 because some dependencies install it but breaks Python 3.4+. # See PR #8103 for more info. RUN pip3 install --no-cache-dir -r requirements_all.txt && \ - pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet cython + pip3 install --no-cache-dir mysqlclient psycopg2 uvloop cchardet cython tensorflow # Copy source COPY . . From be3800d9a5f44a369e825f5324964316429e6821 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 5 Nov 2018 13:21:03 +0100 Subject: [PATCH 10/39] Cloud conf (#18216) * Add original config to entityfilter * Add alexa/google config to cloud status call * Lint --- homeassistant/components/cloud/__init__.py | 4 +-- homeassistant/components/cloud/http_api.py | 6 ++++ homeassistant/helpers/entityfilter.py | 28 +++++++++------ tests/components/cloud/test_http_api.py | 40 +++++++++++++++++++--- tests/helpers/test_entityfilter.py | 16 +++++++-- 5 files changed, 74 insertions(+), 20 deletions(-) diff --git a/homeassistant/components/cloud/__init__.py b/homeassistant/components/cloud/__init__.py index ba2d41a9feb..bc486eb7ead 100644 --- a/homeassistant/components/cloud/__init__.py +++ b/homeassistant/components/cloud/__init__.py @@ -122,7 +122,7 @@ class Cloud: self.hass = hass self.mode = mode self.alexa_config = alexa - self._google_actions = google_actions + self.google_actions_user_conf = google_actions self._gactions_config = None self._prefs = None self.id_token = None @@ -180,7 +180,7 @@ class Cloud: def gactions_config(self): """Return the Google Assistant config.""" if self._gactions_config is None: - conf = self._google_actions + conf = self.google_actions_user_conf def should_expose(entity): """If an entity should be exposed.""" diff --git a/homeassistant/components/cloud/http_api.py b/homeassistant/components/cloud/http_api.py index 0df4a39406e..cb62d773dfd 100644 --- a/homeassistant/components/cloud/http_api.py +++ b/homeassistant/components/cloud/http_api.py @@ -11,6 +11,8 @@ from homeassistant.components.http import HomeAssistantView from homeassistant.components.http.data_validator import ( RequestDataValidator) from homeassistant.components import websocket_api +from homeassistant.components.alexa import smart_home as alexa_sh +from homeassistant.components.google_assistant import smart_home as google_sh from . import auth_api from .const import DOMAIN, REQUEST_TIMEOUT @@ -307,5 +309,9 @@ def _account_data(cloud): 'email': claims['email'], 'cloud': cloud.iot.state, 'google_enabled': cloud.google_enabled, + 'google_entities': cloud.google_actions_user_conf['filter'].config, + 'google_domains': list(google_sh.DOMAIN_TO_GOOGLE_TYPES), 'alexa_enabled': cloud.alexa_enabled, + 'alexa_entities': cloud.alexa_config.should_expose.config, + 'alexa_domains': list(alexa_sh.ENTITY_ADAPTERS), } diff --git a/homeassistant/helpers/entityfilter.py b/homeassistant/helpers/entityfilter.py index c9554488aa7..141fc912275 100644 --- a/homeassistant/helpers/entityfilter.py +++ b/homeassistant/helpers/entityfilter.py @@ -10,6 +10,18 @@ CONF_INCLUDE_ENTITIES = 'include_entities' CONF_EXCLUDE_DOMAINS = 'exclude_domains' CONF_EXCLUDE_ENTITIES = 'exclude_entities' + +def _convert_filter(config): + filt = generate_filter( + config[CONF_INCLUDE_DOMAINS], + config[CONF_INCLUDE_ENTITIES], + config[CONF_EXCLUDE_DOMAINS], + config[CONF_EXCLUDE_ENTITIES], + ) + filt.config = config + return filt + + FILTER_SCHEMA = vol.All( vol.Schema({ vol.Optional(CONF_EXCLUDE_DOMAINS, default=[]): @@ -18,13 +30,7 @@ FILTER_SCHEMA = vol.All( vol.Optional(CONF_INCLUDE_DOMAINS, default=[]): vol.All(cv.ensure_list, [cv.string]), vol.Optional(CONF_INCLUDE_ENTITIES, default=[]): cv.entity_ids, - }), - lambda config: generate_filter( - config[CONF_INCLUDE_DOMAINS], - config[CONF_INCLUDE_ENTITIES], - config[CONF_EXCLUDE_DOMAINS], - config[CONF_EXCLUDE_ENTITIES], - )) + }), _convert_filter) def generate_filter(include_domains, include_entities, @@ -64,8 +70,8 @@ def generate_filter(include_domains, include_entities, # Case 4 - both includes and excludes specified # Case 4a - include domain specified - # - if domain is included, and entity not excluded, pass - # - if domain is not included, and entity not included, fail + # - if domain is included, pass if entity not excluded + # - if domain is not included, pass if entity is included # note: if both include and exclude domains specified, # the exclude domains are ignored if include_d: @@ -79,8 +85,8 @@ def generate_filter(include_domains, include_entities, return entity_filter_4a # Case 4b - exclude domain specified - # - if domain is excluded, and entity not included, fail - # - if domain is not excluded, and entity not excluded, pass + # - if domain is excluded, pass if entity is included + # - if domain is not excluded, pass if entity not excluded if exclude_d: def entity_filter_4b(entity_id): """Return filter function for case 4b.""" diff --git a/tests/components/cloud/test_http_api.py b/tests/components/cloud/test_http_api.py index e27760bd6ed..a8128c8d3e0 100644 --- a/tests/components/cloud/test_http_api.py +++ b/tests/components/cloud/test_http_api.py @@ -35,6 +35,16 @@ def setup_api(hass): 'relayer': 'relayer', 'google_actions_sync_url': GOOGLE_ACTIONS_SYNC_URL, 'subscription_info_url': SUBSCRIPTION_INFO_URL, + 'google_actions': { + 'filter': { + 'include_domains': 'light' + } + }, + 'alexa': { + 'filter': { + 'include_entities': ['light.kitchen', 'switch.ac'] + } + } }) return mock_cloud_prefs(hass) @@ -325,17 +335,37 @@ async def test_websocket_status(hass, hass_ws_client, mock_cloud_fixture): }, 'test') hass.data[DOMAIN].iot.state = iot.STATE_CONNECTED client = await hass_ws_client(hass) - await client.send_json({ - 'id': 5, - 'type': 'cloud/status' - }) - response = await client.receive_json() + + with patch.dict( + 'homeassistant.components.google_assistant.smart_home.' + 'DOMAIN_TO_GOOGLE_TYPES', {'light': None}, clear=True + ), patch.dict('homeassistant.components.alexa.smart_home.ENTITY_ADAPTERS', + {'switch': None}, clear=True): + await client.send_json({ + 'id': 5, + 'type': 'cloud/status' + }) + response = await client.receive_json() assert response['result'] == { 'logged_in': True, 'email': 'hello@home-assistant.io', 'cloud': 'connected', 'alexa_enabled': True, + 'alexa_entities': { + 'include_domains': [], + 'include_entities': ['light.kitchen', 'switch.ac'], + 'exclude_domains': [], + 'exclude_entities': [], + }, + 'alexa_domains': ['switch'], 'google_enabled': True, + 'google_entities': { + 'include_domains': ['light'], + 'include_entities': [], + 'exclude_domains': [], + 'exclude_entities': [], + }, + 'google_domains': ['light'], } diff --git a/tests/helpers/test_entityfilter.py b/tests/helpers/test_entityfilter.py index 944224a34d1..13e5bc1d273 100644 --- a/tests/helpers/test_entityfilter.py +++ b/tests/helpers/test_entityfilter.py @@ -1,5 +1,5 @@ """The tests for the EntityFilter component.""" -from homeassistant.helpers.entityfilter import generate_filter +from homeassistant.helpers.entityfilter import generate_filter, FILTER_SCHEMA def test_no_filters_case_1(): @@ -78,7 +78,7 @@ def test_exclude_domain_case4b(): assert testfilter("sun.sun") is True -def testno_domain_case4c(): +def test_no_domain_case4c(): """Test case 4c - include and exclude specified, with no domains.""" incl_dom = {} incl_ent = {'binary_sensor.working'} @@ -93,3 +93,15 @@ def testno_domain_case4c(): assert testfilter("binary_sensor.working") assert testfilter("binary_sensor.another") is False assert testfilter("sun.sun") is False + + +def test_filter_schema(): + """Test filter schema.""" + conf = { + 'include_domains': ['light'], + 'include_entities': ['switch.kitchen'], + 'exclude_domains': ['cover'], + 'exclude_entities': ['light.kitchen'] + } + filt = FILTER_SCHEMA(conf) + assert filt.config == conf From fb947288ad82ef15559a147f992964f065c1dca8 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 5 Nov 2018 21:41:19 +0100 Subject: [PATCH 11/39] Check if os has chown (#18229) --- homeassistant/util/ruamel_yaml.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homeassistant/util/ruamel_yaml.py b/homeassistant/util/ruamel_yaml.py index c3035811344..eb3e935c6ce 100644 --- a/homeassistant/util/ruamel_yaml.py +++ b/homeassistant/util/ruamel_yaml.py @@ -109,10 +109,11 @@ def save_yaml(fname: str, data: JSON_TYPE) -> None: as temp_file: yaml.dump(data, temp_file) os.replace(tmp_fname, fname) - try: - os.chown(fname, file_stat.st_uid, file_stat.st_gid) - except OSError: - pass + if hasattr(os, 'chown'): + try: + os.chown(fname, file_stat.st_uid, file_stat.st_gid) + except OSError: + pass except YAMLError as exc: _LOGGER.error(str(exc)) raise HomeAssistantError(exc) From 30fccc696e2e0a590824514614876d363797ee0b Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 5 Nov 2018 21:41:48 +0100 Subject: [PATCH 12/39] Bumped version to 0.82.0b2 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 2e0ef79d8f8..e960739ff12 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 82 -PATCH_VERSION = '0b1' +PATCH_VERSION = '0b2' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 782f5c7d190b99906110aab7ef18140aa3e2e4f8 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 7 Nov 2018 10:36:15 +0100 Subject: [PATCH 13/39] Bump frontend to 20181103.2 --- homeassistant/components/frontend/__init__.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index 450daf5eb4c..e8ae0df06ee 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -24,7 +24,7 @@ from homeassistant.core import callback from homeassistant.helpers.translation import async_get_translations from homeassistant.loader import bind_hass -REQUIREMENTS = ['home-assistant-frontend==20181103.1'] +REQUIREMENTS = ['home-assistant-frontend==20181103.2'] DOMAIN = 'frontend' DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log', diff --git a/requirements_all.txt b/requirements_all.txt index 48673ee31ca..9b417f103de 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -476,7 +476,7 @@ hole==0.3.0 holidays==0.9.8 # homeassistant.components.frontend -home-assistant-frontend==20181103.1 +home-assistant-frontend==20181103.2 # homeassistant.components.homekit_controller # homekit==0.10 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 75e21b33c38..d5f3602faa5 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -97,7 +97,7 @@ hdate==0.6.5 holidays==0.9.8 # homeassistant.components.frontend -home-assistant-frontend==20181103.1 +home-assistant-frontend==20181103.2 # homeassistant.components.homematicip_cloud homematicip==0.9.8 From 0b6aa38b1316bdcfc18ea17bb7f56c4920088caa Mon Sep 17 00:00:00 2001 From: Mikko Tapionlinna Date: Tue, 6 Nov 2018 02:00:46 +0200 Subject: [PATCH 14/39] Update pynetgear to 0.5.1 (#18238) --- homeassistant/components/device_tracker/netgear.py | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/device_tracker/netgear.py b/homeassistant/components/device_tracker/netgear.py index 12d026a35cd..99d379fb4d3 100644 --- a/homeassistant/components/device_tracker/netgear.py +++ b/homeassistant/components/device_tracker/netgear.py @@ -15,7 +15,7 @@ from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_PORT, CONF_SSL, CONF_DEVICES, CONF_EXCLUDE) -REQUIREMENTS = ['pynetgear==0.5.0'] +REQUIREMENTS = ['pynetgear==0.5.1'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index 9b417f103de..fd9f959efb9 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1026,7 +1026,7 @@ pymysensors==0.17.0 pynello==1.5.1 # homeassistant.components.device_tracker.netgear -pynetgear==0.5.0 +pynetgear==0.5.1 # homeassistant.components.switch.netio pynetio==0.1.9.1 From 17f04c1736d50d1fba091c6bd4f25f7aea5b7ea7 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 6 Nov 2018 22:08:04 +0100 Subject: [PATCH 15/39] Migrate python-openzwave to homeassistant-pyozw (#18268) * Migrate python-openzwave to homeassistant-pyozw * Update requirements_all.txt * Fix requirements --- homeassistant/components/zwave/__init__.py | 2 +- requirements_all.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/zwave/__init__.py b/homeassistant/components/zwave/__init__.py index a4f8dcd1b3f..a27d2112dcd 100644 --- a/homeassistant/components/zwave/__init__.py +++ b/homeassistant/components/zwave/__init__.py @@ -42,7 +42,7 @@ from .discovery_schemas import DISCOVERY_SCHEMAS from .util import (check_node_schema, check_value_schema, node_name, check_has_unique_id, is_node_parsed) -REQUIREMENTS = ['pydispatcher==2.0.5', 'python_openzwave==0.4.10'] +REQUIREMENTS = ['pydispatcher==2.0.5', 'homeassistant-pyozw==0.1.0'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index fd9f959efb9..a2efa7e269a 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -478,6 +478,9 @@ holidays==0.9.8 # homeassistant.components.frontend home-assistant-frontend==20181103.2 +# homeassistant.components.zwave +homeassistant-pyozw==0.1.0 + # homeassistant.components.homekit_controller # homekit==0.10 @@ -1227,9 +1230,6 @@ python-wink==1.10.1 # homeassistant.components.sensor.swiss_public_transport python_opendata_transport==0.1.4 -# homeassistant.components.zwave -python_openzwave==0.4.10 - # homeassistant.components.egardia pythonegardia==1.0.39 From cff475570841515cfb38f821fc77a02b55082974 Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Wed, 7 Nov 2018 08:52:51 +0200 Subject: [PATCH 16/39] SMA Guard against older pysma (#18278) --- homeassistant/components/sensor/sma.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/sensor/sma.py b/homeassistant/components/sensor/sma.py index 3f17b4971ec..acf1ead186c 100644 --- a/homeassistant/components/sensor/sma.py +++ b/homeassistant/components/sensor/sma.py @@ -37,11 +37,11 @@ def _check_sensor_schema(conf): """Check sensors and attributes are valid.""" try: import pysma - except ImportError: + valid = [s.name for s in pysma.SENSORS] + except (ImportError, AttributeError): return conf - valid = list(conf[CONF_CUSTOM].keys()) - valid.extend([s.name for s in pysma.SENSORS]) + valid.extend(conf[CONF_CUSTOM].keys()) for sname, attrs in conf[CONF_SENSORS].items(): if sname not in valid: raise vol.Invalid("{} does not exist".format(sname)) From 06b9600069e22bfedfa9b976b674bc9405056d93 Mon Sep 17 00:00:00 2001 From: mvn23 Date: Wed, 7 Nov 2018 09:55:22 +0100 Subject: [PATCH 17/39] Bump pyotgw to 0.3b1 (#18286) * Bump pyotgw to 0.3b1 * Update requirements_all.txt --- homeassistant/components/opentherm_gw/__init__.py | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/opentherm_gw/__init__.py b/homeassistant/components/opentherm_gw/__init__.py index 3cf66c72a3a..06dcd0e19b0 100644 --- a/homeassistant/components/opentherm_gw/__init__.py +++ b/homeassistant/components/opentherm_gw/__init__.py @@ -104,7 +104,7 @@ CONFIG_SCHEMA = vol.Schema({ }), }, extra=vol.ALLOW_EXTRA) -REQUIREMENTS = ['pyotgw==0.3b0'] +REQUIREMENTS = ['pyotgw==0.3b1'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index a2efa7e269a..e84950765d1 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1054,7 +1054,7 @@ pyoppleio==1.0.5 pyota==2.0.5 # homeassistant.components.opentherm_gw -pyotgw==0.3b0 +pyotgw==0.3b1 # homeassistant.auth.mfa_modules.notify # homeassistant.auth.mfa_modules.totp From e9b8b290fc83a1b3edb7478511904e2f072f9fb6 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 7 Nov 2018 10:37:57 +0100 Subject: [PATCH 18/39] Bumped version to 0.82.0b3 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index e960739ff12..6b907e9ccde 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 82 -PATCH_VERSION = '0b2' +PATCH_VERSION = '0b3' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From f541b101c9fd32879b4df3bb646130da7796b187 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 4 Nov 2018 12:19:04 +0100 Subject: [PATCH 19/39] Bugfix discovery (delete/mqtt) call for Hass.io (#18159) * Bugfix discovery delete call for Hass.io * Fix host * fix tests --- homeassistant/components/hassio/discovery.py | 2 +- homeassistant/components/mqtt/config_flow.py | 6 +++--- tests/components/mqtt/test_config_flow.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/hassio/discovery.py b/homeassistant/components/hassio/discovery.py index 4c7c5a6597f..a5f62b9e1a1 100644 --- a/homeassistant/components/hassio/discovery.py +++ b/homeassistant/components/hassio/discovery.py @@ -71,7 +71,7 @@ class HassIODiscovery(HomeAssistantView): async def delete(self, request, uuid): """Handle remove discovery requests.""" - data = request.json() + data = await request.json() await self.async_process_del(data) return web.Response() diff --git a/homeassistant/components/mqtt/config_flow.py b/homeassistant/components/mqtt/config_flow.py index e0d1e692c60..aee825d06de 100644 --- a/homeassistant/components/mqtt/config_flow.py +++ b/homeassistant/components/mqtt/config_flow.py @@ -6,7 +6,7 @@ import voluptuous as vol from homeassistant import config_entries from homeassistant.const import ( - CONF_PASSWORD, CONF_PORT, CONF_USERNAME, CONF_PROTOCOL) + CONF_PASSWORD, CONF_PORT, CONF_USERNAME, CONF_PROTOCOL, CONF_HOST) from .const import CONF_BROKER, CONF_DISCOVERY, DEFAULT_DISCOVERY @@ -80,7 +80,7 @@ class FlowHandler(config_entries.ConfigFlow): data = self._hassio_discovery can_connect = await self.hass.async_add_executor_job( try_connection, - data[CONF_BROKER], + data[CONF_HOST], data[CONF_PORT], data.get(CONF_USERNAME), data.get(CONF_PASSWORD), @@ -90,7 +90,7 @@ class FlowHandler(config_entries.ConfigFlow): if can_connect: return self.async_create_entry( title=data['addon'], data={ - CONF_BROKER: data[CONF_BROKER], + CONF_BROKER: data[CONF_HOST], CONF_PORT: data[CONF_PORT], CONF_USERNAME: data.get(CONF_USERNAME), CONF_PASSWORD: data.get(CONF_PASSWORD), diff --git a/tests/components/mqtt/test_config_flow.py b/tests/components/mqtt/test_config_flow.py index 08bb4e54a39..66bf9b97807 100644 --- a/tests/components/mqtt/test_config_flow.py +++ b/tests/components/mqtt/test_config_flow.py @@ -119,7 +119,7 @@ async def test_hassio_confirm(hass, mock_try_connection, 'mqtt', data={ 'addon': 'Mock Addon', - 'broker': 'mock-broker', + 'host': 'mock-broker', 'port': 1883, 'username': 'mock-user', 'password': 'mock-pass', From f24979c7cf19d5dbf0f4ec41d95fa8c75edc88d1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 7 Nov 2018 21:58:18 +0100 Subject: [PATCH 20/39] Bumped version to 0.82.0b4 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 6b907e9ccde..9a8678072f3 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 82 -PATCH_VERSION = '0b3' +PATCH_VERSION = '0b4' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 878e369c4a99e40dd162493020a022636d7ff84a Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 8 Nov 2018 00:33:51 +0100 Subject: [PATCH 21/39] Fix log error message (#18305) * Fix log error message * Update __init__.py --- homeassistant/components/hassio/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/hassio/__init__.py b/homeassistant/components/hassio/__init__.py index 9516675480a..8523bb5ea64 100644 --- a/homeassistant/components/hassio/__init__.py +++ b/homeassistant/components/hassio/__init__.py @@ -143,9 +143,10 @@ async def async_check_config(hass): result = await hassio.check_homeassistant_config() except HassioAPIError as err: _LOGGER.error("Error on Hass.io API: %s", err) + else: + if result['result'] == "error": + return result['message'] - if result['result'] == "error": - return result['message'] return None From a016dd21405f7adbb7a188c466fc229499d55899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Thu, 8 Nov 2018 09:27:51 +0100 Subject: [PATCH 22/39] Bump pyhaversion to 2.0.2 (#18318) --- homeassistant/components/sensor/version.py | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/version.py b/homeassistant/components/sensor/version.py index b71ae158181..11cb6832e40 100644 --- a/homeassistant/components/sensor/version.py +++ b/homeassistant/components/sensor/version.py @@ -16,7 +16,7 @@ from homeassistant.const import CONF_NAME, CONF_SOURCE from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle -REQUIREMENTS = ['pyhaversion==2.0.1'] +REQUIREMENTS = ['pyhaversion==2.0.2'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index e84950765d1..583707513ee 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -932,7 +932,7 @@ pygtfs-homeassistant==0.1.3.dev0 pyharmony==1.0.20 # homeassistant.components.sensor.version -pyhaversion==2.0.1 +pyhaversion==2.0.2 # homeassistant.components.binary_sensor.hikvision pyhik==0.1.8 From de37fc90c0022dfc574fb23d146159f9dd69dc41 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 9 Nov 2018 15:40:46 +0100 Subject: [PATCH 23/39] Bump frontend to 20181103.3 --- homeassistant/components/frontend/__init__.py | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/__init__.py b/homeassistant/components/frontend/__init__.py index e8ae0df06ee..1d6721306fd 100644 --- a/homeassistant/components/frontend/__init__.py +++ b/homeassistant/components/frontend/__init__.py @@ -24,7 +24,7 @@ from homeassistant.core import callback from homeassistant.helpers.translation import async_get_translations from homeassistant.loader import bind_hass -REQUIREMENTS = ['home-assistant-frontend==20181103.2'] +REQUIREMENTS = ['home-assistant-frontend==20181103.3'] DOMAIN = 'frontend' DEPENDENCIES = ['api', 'websocket_api', 'http', 'system_log', diff --git a/requirements_all.txt b/requirements_all.txt index 583707513ee..411fbae9911 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -476,7 +476,7 @@ hole==0.3.0 holidays==0.9.8 # homeassistant.components.frontend -home-assistant-frontend==20181103.2 +home-assistant-frontend==20181103.3 # homeassistant.components.zwave homeassistant-pyozw==0.1.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index d5f3602faa5..2b0e151feba 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -97,7 +97,7 @@ hdate==0.6.5 holidays==0.9.8 # homeassistant.components.frontend -home-assistant-frontend==20181103.2 +home-assistant-frontend==20181103.3 # homeassistant.components.homematicip_cloud homematicip==0.9.8 From 8ab2f669d2ea8e875db9bb0531864ffc4f593b16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Fri, 9 Nov 2018 11:36:00 +0100 Subject: [PATCH 24/39] Fix xiaomi binary_sensor warning (#18280) * Fix xiaomi binary_sensor warning * Fix xiaomi binary_sensor warning --- homeassistant/components/binary_sensor/xiaomi_aqara.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/binary_sensor/xiaomi_aqara.py b/homeassistant/components/binary_sensor/xiaomi_aqara.py index e082c886f03..45217c42c1d 100644 --- a/homeassistant/components/binary_sensor/xiaomi_aqara.py +++ b/homeassistant/components/binary_sensor/xiaomi_aqara.py @@ -357,6 +357,9 @@ class XiaomiVibration(XiaomiBinarySensor): def parse_data(self, data, raw_data): """Parse data sent by gateway.""" value = data.get(self._data_key) + if value is None: + return False + if value not in ('vibrate', 'tilt', 'free_fall'): _LOGGER.warning("Unsupported movement_type detected: %s", value) From f4c35a389d841ace6a21223ffa2905a033ff4e53 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 8 Nov 2018 11:17:44 +0100 Subject: [PATCH 25/39] Remove Velbus climate platform (#18319) --- homeassistant/components/climate/velbus.py | 81 ---------------------- homeassistant/components/velbus.py | 3 - 2 files changed, 84 deletions(-) delete mode 100644 homeassistant/components/climate/velbus.py diff --git a/homeassistant/components/climate/velbus.py b/homeassistant/components/climate/velbus.py deleted file mode 100644 index ab8542541c8..00000000000 --- a/homeassistant/components/climate/velbus.py +++ /dev/null @@ -1,81 +0,0 @@ -""" -Support for Velbus thermostat. - -For more details about this platform, please refer to the documentation -https://home-assistant.io/components/climate.velbus/ -""" -import logging - -from homeassistant.components.climate import ( - SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE, ClimateDevice) -from homeassistant.components.velbus import ( - DOMAIN as VELBUS_DOMAIN, VelbusEntity) -from homeassistant.const import ATTR_TEMPERATURE - -_LOGGER = logging.getLogger(__name__) - -DEPENDENCIES = ['velbus'] - -OPERATION_LIST = ['comfort', 'day', 'night', 'safe'] - -SUPPORT_FLAGS = (SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE) - - -async def async_setup_platform( - hass, config, async_add_entities, discovery_info=None): - """Set up the Velbus thermostat platform.""" - if discovery_info is None: - return - - sensors = [] - for sensor in discovery_info: - module = hass.data[VELBUS_DOMAIN].get_module(sensor[0]) - channel = sensor[1] - sensors.append(VelbusClimate(module, channel)) - - async_add_entities(sensors) - - -class VelbusClimate(VelbusEntity, ClimateDevice): - """Representation of a Velbus thermostat.""" - - @property - def supported_features(self): - """Return the list off supported features.""" - return SUPPORT_FLAGS - - @property - def temperature_unit(self): - """Return the unit this state is expressed in.""" - return self._module.get_unit(self._channel) - - @property - def current_temperature(self): - """Return the current temperature.""" - return self._module.get_state(self._channel) - - @property - def current_operation(self): - """Return current operation ie. heat, cool, idle.""" - return self._module.get_climate_mode() - - @property - def operation_list(self): - """Return the list of available operation modes.""" - return OPERATION_LIST - - @property - def target_temperature(self): - """Return the temperature we try to reach.""" - return self._module.get_climate_target() - - def set_operation_mode(self, operation_mode): - """Set new target operation mode.""" - self._module.set_mode(operation_mode) - self.schedule_update_ha_state() - - def set_temperature(self, **kwargs): - """Set new target temperatures.""" - if kwargs.get(ATTR_TEMPERATURE) is not None: - self._module.set_temp(kwargs.get(ATTR_TEMPERATURE)) - self.schedule_update_ha_state() diff --git a/homeassistant/components/velbus.py b/homeassistant/components/velbus.py index 294061527f8..a7b385297a8 100644 --- a/homeassistant/components/velbus.py +++ b/homeassistant/components/velbus.py @@ -47,7 +47,6 @@ async def async_setup(hass, config): modules = controller.get_modules() discovery_info = { 'switch': [], - 'climate': [], 'binary_sensor': [], 'sensor': [] } @@ -61,8 +60,6 @@ async def async_setup(hass, config): )) load_platform(hass, 'switch', DOMAIN, discovery_info['switch'], config) - load_platform(hass, 'climate', DOMAIN, - discovery_info['climate'], config) load_platform(hass, 'binary_sensor', DOMAIN, discovery_info['binary_sensor'], config) load_platform(hass, 'sensor', DOMAIN, From 7f48a280eefd4882bc1f25c7a4df32a4f6e37826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ab=C3=ADlio=20Costa?= Date: Fri, 9 Nov 2018 09:41:08 +0000 Subject: [PATCH 26/39] fix last device ignored (#18329) --- homeassistant/components/device_tracker/huawei_router.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/device_tracker/huawei_router.py b/homeassistant/components/device_tracker/huawei_router.py index f5e4fa8a714..18f3c0b8c62 100644 --- a/homeassistant/components/device_tracker/huawei_router.py +++ b/homeassistant/components/device_tracker/huawei_router.py @@ -39,7 +39,7 @@ Device = namedtuple('Device', ['name', 'ip', 'mac', 'state']) class HuaweiDeviceScanner(DeviceScanner): """This class queries a router running HUAWEI firmware.""" - ARRAY_REGEX = re.compile(r'var UserDevinfo = new Array\((.*),null\);') + ARRAY_REGEX = re.compile(r'var UserDevinfo = new Array\((.*)null\);') DEVICE_REGEX = re.compile(r'new USERDevice\((.*?)\),') DEVICE_ATTR_REGEX = re.compile( '"(?P.*?)","(?P.*?)",' From 4324d8767319527edc08a7329bb0d9b878146bb0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 9 Nov 2018 15:42:17 +0100 Subject: [PATCH 27/39] Bumped version to 0.82.0 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 9a8678072f3..5bd6b7637ff 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 82 -PATCH_VERSION = '0b4' +PATCH_VERSION = '0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From f7c99ada9daa65f79c38f5ca7bca0c2054b231e9 Mon Sep 17 00:00:00 2001 From: Adam Belebczuk Date: Sat, 10 Nov 2018 02:17:24 -0500 Subject: [PATCH 28/39] WeMo - Change name of discovery option (#18348) --- homeassistant/components/wemo.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/wemo.py b/homeassistant/components/wemo.py index 55e45bc210a..3804b019ad5 100644 --- a/homeassistant/components/wemo.py +++ b/homeassistant/components/wemo.py @@ -58,17 +58,17 @@ def coerce_host_port(value): CONF_STATIC = 'static' -CONF_DISABLE_DISCOVERY = 'disable_discovery' +CONF_DISCOVERY = 'discovery' -DEFAULT_DISABLE_DISCOVERY = False +DEFAULT_DISCOVERY = True CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Optional(CONF_STATIC, default=[]): vol.Schema([ vol.All(cv.string, coerce_host_port) ]), - vol.Optional(CONF_DISABLE_DISCOVERY, - default=DEFAULT_DISABLE_DISCOVERY): cv.boolean + vol.Optional(CONF_DISCOVERY, + default=DEFAULT_DISCOVERY): cv.boolean }), }, extra=vol.ALLOW_EXTRA) @@ -141,9 +141,7 @@ def setup(hass, config): devices.append((url, device)) - disable_discovery = config.get(DOMAIN, {}).get(CONF_DISABLE_DISCOVERY) - - if not disable_discovery: + if config.get(DOMAIN, {}).get(CONF_DISCOVERY): _LOGGER.debug("Scanning for WeMo devices.") devices.extend( (setup_url_for_device(device), device) From 466d3a5ef82ca73c359f1bbb18b2a5854ccdb217 Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Sun, 11 Nov 2018 11:44:41 -0500 Subject: [PATCH 29/39] catch key error when saving image (#18365) --- homeassistant/components/image_processing/tensorflow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/image_processing/tensorflow.py b/homeassistant/components/image_processing/tensorflow.py index a2cd997bb76..2d06dbbcf34 100644 --- a/homeassistant/components/image_processing/tensorflow.py +++ b/homeassistant/components/image_processing/tensorflow.py @@ -246,7 +246,8 @@ class TensorFlowImageProcessor(ImageProcessingEntity): for category, values in matches.items(): # Draw custom category regions/areas - if self._category_areas[category] != [0, 0, 1, 1]: + if (category in self._category_areas + and self._category_areas[category] != [0, 0, 1, 1]): label = "{} Detection Area".format(category.capitalize()) draw_box(draw, self._category_areas[category], img_width, img_height, label, (0, 255, 0)) From 6bcba1fbeab1e02296ae361a8c68f3a379d00033 Mon Sep 17 00:00:00 2001 From: Martin Hjelmare Date: Sun, 11 Nov 2018 17:46:28 +0100 Subject: [PATCH 30/39] Fix hangouts notify (#18372) * Remove notify schema from hangouts platform * Notify platforms shouldn't overwrite the notify component service schema. That has no effect. * Fix hangouts service data key value --- homeassistant/components/notify/hangouts.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/notify/hangouts.py b/homeassistant/components/notify/hangouts.py index 01f98146f4c..7261663b99f 100644 --- a/homeassistant/components/notify/hangouts.py +++ b/homeassistant/components/notify/hangouts.py @@ -9,13 +9,12 @@ import logging import voluptuous as vol from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA, - NOTIFY_SERVICE_SCHEMA, BaseNotificationService, ATTR_MESSAGE, ATTR_DATA) from homeassistant.components.hangouts.const \ - import (DOMAIN, SERVICE_SEND_MESSAGE, MESSAGE_DATA_SCHEMA, - TARGETS_SCHEMA, CONF_DEFAULT_CONVERSATIONS) + import (DOMAIN, SERVICE_SEND_MESSAGE, TARGETS_SCHEMA, + CONF_DEFAULT_CONVERSATIONS) _LOGGER = logging.getLogger(__name__) @@ -25,11 +24,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Required(CONF_DEFAULT_CONVERSATIONS): [TARGETS_SCHEMA] }) -NOTIFY_SERVICE_SCHEMA = NOTIFY_SERVICE_SCHEMA.extend({ - vol.Optional(ATTR_TARGET): [TARGETS_SCHEMA], - vol.Optional(ATTR_DATA, default={}): MESSAGE_DATA_SCHEMA -}) - def get_service(hass, config, discovery_info=None): """Get the Hangouts notification service.""" @@ -61,8 +55,9 @@ class HangoutsNotificationService(BaseNotificationService): service_data = { ATTR_TARGET: target_conversations, ATTR_MESSAGE: messages, - ATTR_DATA: kwargs[ATTR_DATA] } + if kwargs[ATTR_DATA]: + service_data[ATTR_DATA] = kwargs[ATTR_DATA] return self.hass.services.call( DOMAIN, SERVICE_SEND_MESSAGE, service_data=service_data) From 2aa2233d9b6212a75c95528bc931180cf5fefcce Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Sun, 11 Nov 2018 17:15:58 +0100 Subject: [PATCH 31/39] Fix including from sub dir (#18378) The include path is now always relative to the root of the config dir. --- homeassistant/util/ruamel_yaml.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/util/ruamel_yaml.py b/homeassistant/util/ruamel_yaml.py index eb3e935c6ce..8211252a516 100644 --- a/homeassistant/util/ruamel_yaml.py +++ b/homeassistant/util/ruamel_yaml.py @@ -80,7 +80,8 @@ def load_yaml(fname: str, round_trip: bool = False) -> JSON_TYPE: yaml = YAML(typ='rt') yaml.preserve_quotes = True else: - ExtSafeConstructor.name = fname + if not hasattr(ExtSafeConstructor, 'name'): + ExtSafeConstructor.name = fname yaml = YAML(typ='safe') yaml.Constructor = ExtSafeConstructor From b8ddbc3fdb03f395feefd1e1a9f62afe7256aeaf Mon Sep 17 00:00:00 2001 From: Clayton Nummer Date: Sun, 11 Nov 2018 16:55:45 -0500 Subject: [PATCH 32/39] Fix default value for optional Sense configuration parameter (#18379) --- homeassistant/components/sense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sense.py b/homeassistant/components/sense.py index 3792e10e761..6e9204b80e1 100644 --- a/homeassistant/components/sense.py +++ b/homeassistant/components/sense.py @@ -27,7 +27,7 @@ CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Required(CONF_EMAIL): cv.string, vol.Required(CONF_PASSWORD): cv.string, - vol.Optional(CONF_TIMEOUT, DEFAULT_TIMEOUT): cv.positive_int, + vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int, }) }, extra=vol.ALLOW_EXTRA) From 7659c33439ca401082e6a98252e3a3c320bcf6b7 Mon Sep 17 00:00:00 2001 From: Diogo Gomes Date: Mon, 12 Nov 2018 20:28:00 +0000 Subject: [PATCH 33/39] cancel off_delay action (#18389) --- homeassistant/components/binary_sensor/mqtt.py | 1 + 1 file changed, 1 insertion(+) diff --git a/homeassistant/components/binary_sensor/mqtt.py b/homeassistant/components/binary_sensor/mqtt.py index db9ad585999..7f164ae48d7 100644 --- a/homeassistant/components/binary_sensor/mqtt.py +++ b/homeassistant/components/binary_sensor/mqtt.py @@ -155,6 +155,7 @@ class MqttBinarySensor(MqttAvailability, MqttDiscoveryUpdate, if self._delay_listener is not None: self._delay_listener() + self._delay_listener = None if (self._state and self._off_delay is not None): self._delay_listener = evt.async_call_later( From 43271ca0f7ff5d9ceaf337a9a7cb344c4f14ac4e Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 15 Nov 2018 14:01:02 +0100 Subject: [PATCH 34/39] Bump aioasuswrt to 1.1.6 --- homeassistant/components/device_tracker/asuswrt.py | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/device_tracker/asuswrt.py b/homeassistant/components/device_tracker/asuswrt.py index 561d41562de..0e8e9bfe98f 100644 --- a/homeassistant/components/device_tracker/asuswrt.py +++ b/homeassistant/components/device_tracker/asuswrt.py @@ -15,7 +15,7 @@ from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_USERNAME, CONF_PORT, CONF_MODE, CONF_PROTOCOL) -REQUIREMENTS = ['aioasuswrt==1.1.2'] +REQUIREMENTS = ['aioasuswrt==1.1.6'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index 411fbae9911..25fafbe1d55 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -86,7 +86,7 @@ abodepy==0.14.0 afsapi==0.0.4 # homeassistant.components.device_tracker.asuswrt -aioasuswrt==1.1.2 +aioasuswrt==1.1.6 # homeassistant.components.device_tracker.automatic aioautomatic==0.6.5 From b5d4e18880fb9de0ec56def8eaf893ecec20be5d Mon Sep 17 00:00:00 2001 From: Pawel Date: Mon, 12 Nov 2018 20:46:00 +0100 Subject: [PATCH 35/39] Changed checking of cover state closed from 0 to closed_position variable. (#18407) Change error message to avoid expression "get_position_topic". --- homeassistant/components/cover/mqtt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/cover/mqtt.py b/homeassistant/components/cover/mqtt.py index 8cc80c52bc5..235b28b5be2 100644 --- a/homeassistant/components/cover/mqtt.py +++ b/homeassistant/components/cover/mqtt.py @@ -87,7 +87,7 @@ def validate_options(value): if (CONF_SET_POSITION_TOPIC in value and CONF_GET_POSITION_TOPIC not in value): raise vol.Invalid( - "Set position topic must be set together with get position topic.") + "set_position_topic must be set together with position_topic.") return value @@ -287,7 +287,7 @@ class MqttCover(MqttAvailability, MqttDiscoveryUpdate, MqttEntityDeviceInfo, float(payload), COVER_PAYLOAD) if 0 <= percentage_payload <= 100: self._position = percentage_payload - self._state = self._position == 0 + self._state = self._position == self._position_closed else: _LOGGER.warning( "Payload is not integer within range: %s", @@ -451,7 +451,7 @@ class MqttCover(MqttAvailability, MqttDiscoveryUpdate, MqttEntityDeviceInfo, mqtt.async_publish(self.hass, self._set_position_topic, position, self._qos, self._retain) if self._optimistic: - self._state = percentage_position == 0 + self._state = percentage_position == self._position_closed self._position = percentage_position self.async_schedule_update_ha_state() From f36b94b37668fa144c82eb5c324b3b169da8030b Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Mon, 12 Nov 2018 22:53:50 +0100 Subject: [PATCH 36/39] updated pydaikin version (#18413) --- homeassistant/components/climate/daikin.py | 2 +- homeassistant/components/daikin.py | 8 ++------ requirements_all.txt | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/climate/daikin.py b/homeassistant/components/climate/daikin.py index 2d4e01aaee9..63b8f585c7e 100644 --- a/homeassistant/components/climate/daikin.py +++ b/homeassistant/components/climate/daikin.py @@ -22,7 +22,7 @@ from homeassistant.const import ( ATTR_TEMPERATURE, CONF_HOST, CONF_NAME, TEMP_CELSIUS) import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['pydaikin==0.4'] +REQUIREMENTS = ['pydaikin==0.6'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/daikin.py b/homeassistant/components/daikin.py index 8983ecf82d8..20da244a698 100644 --- a/homeassistant/components/daikin.py +++ b/homeassistant/components/daikin.py @@ -19,12 +19,11 @@ from homeassistant.helpers import discovery from homeassistant.helpers.discovery import load_platform from homeassistant.util import Throttle -REQUIREMENTS = ['pydaikin==0.4'] +REQUIREMENTS = ['pydaikin==0.6'] _LOGGER = logging.getLogger(__name__) DOMAIN = 'daikin' -HTTP_RESOURCES = ['aircon/get_sensor_info', 'aircon/get_control_info'] ATTR_TARGET_TEMPERATURE = 'target_temperature' ATTR_INSIDE_TEMPERATURE = 'inside_temperature' @@ -128,10 +127,7 @@ class DaikinApi: def update(self, **kwargs): """Pull the latest data from Daikin.""" try: - for resource in HTTP_RESOURCES: - self.device.values.update( - self.device.get_resource(resource) - ) + self.device.update_status() except timeout: _LOGGER.warning( "Connection failed for %s", self.ip_address diff --git a/requirements_all.txt b/requirements_all.txt index 25fafbe1d55..9759cbbf530 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -865,7 +865,7 @@ pycsspeechtts==1.0.2 # homeassistant.components.daikin # homeassistant.components.climate.daikin -pydaikin==0.4 +pydaikin==0.6 # homeassistant.components.deconz pydeconz==47 From 69d358fa08652e44dc37974bb735cfdc40ccf1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ab=C3=ADlio=20Costa?= Date: Tue, 13 Nov 2018 13:24:30 +0000 Subject: [PATCH 37/39] edp_redy: increase UPDATE_INTERVAL (#18429) The server was getting a bit mad sometimes and would lock users out. --- homeassistant/components/edp_redy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/edp_redy.py b/homeassistant/components/edp_redy.py index caf4ad41d99..210d7eb6afc 100644 --- a/homeassistant/components/edp_redy.py +++ b/homeassistant/components/edp_redy.py @@ -24,7 +24,7 @@ _LOGGER = logging.getLogger(__name__) DOMAIN = 'edp_redy' EDP_REDY = 'edp_redy' DATA_UPDATE_TOPIC = '{0}_data_update'.format(DOMAIN) -UPDATE_INTERVAL = 30 +UPDATE_INTERVAL = 60 REQUIREMENTS = ['edp_redy==0.0.2'] From 5ffcb99b4f9dfbfc948796d240a6f523a2642ccf Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 13 Nov 2018 23:43:01 +0100 Subject: [PATCH 38/39] Update pyozw to 0.1.1 (#18436) * Update pyozw to 0.1.1 * Update requirements_all.txt --- homeassistant/components/zwave/__init__.py | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zwave/__init__.py b/homeassistant/components/zwave/__init__.py index a27d2112dcd..87a955f6f20 100644 --- a/homeassistant/components/zwave/__init__.py +++ b/homeassistant/components/zwave/__init__.py @@ -42,7 +42,7 @@ from .discovery_schemas import DISCOVERY_SCHEMAS from .util import (check_node_schema, check_value_schema, node_name, check_has_unique_id, is_node_parsed) -REQUIREMENTS = ['pydispatcher==2.0.5', 'homeassistant-pyozw==0.1.0'] +REQUIREMENTS = ['pydispatcher==2.0.5', 'homeassistant-pyozw==0.1.1'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index 9759cbbf530..539f89cbdd1 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -479,7 +479,7 @@ holidays==0.9.8 home-assistant-frontend==20181103.3 # homeassistant.components.zwave -homeassistant-pyozw==0.1.0 +homeassistant-pyozw==0.1.1 # homeassistant.components.homekit_controller # homekit==0.10 From b40b934029ef5df82373c6aa4a284bc2e449e850 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 15 Nov 2018 14:01:21 +0100 Subject: [PATCH 39/39] Bumped version to 0.82.1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 5bd6b7637ff..9db85f12960 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 82 -PATCH_VERSION = '0' +PATCH_VERSION = '1' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3)