From 5dc841ecae49b2c1a4aef5e7cd8b2e9565fc1ceb Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 16 May 2019 08:57:43 +0200 Subject: [PATCH 01/12] Fix Hassio-version for Azure Pipelines (#23895) --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fd45c334cf3..ceccb39d5f0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -159,7 +159,7 @@ jobs: git config --global user.email "pvizeli@syshack.ch" git config --global credential.helper store - echo "https://$(githubToken):x-oauth-basic@github.com > $HOME\.git-credentials + echo "https://$(githubToken):x-oauth-basic@github.com" > $HOME\.git-credentials displayName: 'Install requirements' - script: | set -e From 8d2a78483163b7af9a9996caafc686d433621b37 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 16 May 2019 21:21:38 +0200 Subject: [PATCH 02/12] Update Honeywell warning (#23913) --- homeassistant/components/honeywell/climate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/homeassistant/components/honeywell/climate.py b/homeassistant/components/honeywell/climate.py index 5a07b094e24..75bbb2ca5d8 100644 --- a/homeassistant/components/honeywell/climate.py +++ b/homeassistant/components/honeywell/climate.py @@ -55,8 +55,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): _LOGGER.warning( "The honeywell component is deprecated for EU (i.e. non-US) systems, " - "this functionality will be removed in version 0.96.") - _LOGGER.warning( + "this functionality will be removed in version 0.96. " "Please switch to the evohome component, " "see: https://home-assistant.io/components/evohome") From 6030e419c549d68a932cc3067d774f305be8499e Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Thu, 16 May 2019 22:34:40 +0200 Subject: [PATCH 03/12] Switch media player to SWITCH type (#23914) MEDIA device type is being rejected by google now. --- homeassistant/components/google_assistant/const.py | 3 +-- tests/components/google_assistant/__init__.py | 8 ++++---- tests/components/google_assistant/test_smart_home.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/google_assistant/const.py b/homeassistant/components/google_assistant/const.py index 0f15d10f181..92afe90a5ac 100644 --- a/homeassistant/components/google_assistant/const.py +++ b/homeassistant/components/google_assistant/const.py @@ -53,7 +53,6 @@ TYPE_SENSOR = PREFIX_TYPES + 'SENSOR' TYPE_DOOR = PREFIX_TYPES + 'DOOR' TYPE_TV = PREFIX_TYPES + 'TV' TYPE_SPEAKER = PREFIX_TYPES + 'SPEAKER' -TYPE_MEDIA = PREFIX_TYPES + 'MEDIA' SERVICE_REQUEST_SYNC = 'request_sync' HOMEGRAPH_URL = 'https://homegraph.googleapis.com/' @@ -89,7 +88,7 @@ DOMAIN_TO_GOOGLE_TYPES = { input_boolean.DOMAIN: TYPE_SWITCH, light.DOMAIN: TYPE_LIGHT, lock.DOMAIN: TYPE_LOCK, - media_player.DOMAIN: TYPE_MEDIA, + media_player.DOMAIN: TYPE_SWITCH, scene.DOMAIN: TYPE_SCENE, script.DOMAIN: TYPE_SCENE, switch.DOMAIN: TYPE_SWITCH, diff --git a/tests/components/google_assistant/__init__.py b/tests/components/google_assistant/__init__.py index 76ccc79a378..f3732c12213 100644 --- a/tests/components/google_assistant/__init__.py +++ b/tests/components/google_assistant/__init__.py @@ -147,7 +147,7 @@ DEMO_DEVICES = [{ 'action.devices.traits.Modes' ], 'type': - 'action.devices.types.MEDIA', + 'action.devices.types.SWITCH', 'willReportState': False }, { @@ -162,7 +162,7 @@ DEMO_DEVICES = [{ 'action.devices.traits.Modes' ], 'type': - 'action.devices.types.MEDIA', + 'action.devices.types.SWITCH', 'willReportState': False }, { @@ -171,7 +171,7 @@ DEMO_DEVICES = [{ 'name': 'Lounge room' }, 'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Modes'], - 'type': 'action.devices.types.MEDIA', + 'type': 'action.devices.types.SWITCH', 'willReportState': False }, { 'id': @@ -182,7 +182,7 @@ DEMO_DEVICES = [{ 'traits': ['action.devices.traits.OnOff', 'action.devices.traits.Volume'], 'type': - 'action.devices.types.MEDIA', + 'action.devices.types.SWITCH', 'willReportState': False }, { diff --git a/tests/components/google_assistant/test_smart_home.py b/tests/components/google_assistant/test_smart_home.py index ea5291f28f7..519a55fbc00 100644 --- a/tests/components/google_assistant/test_smart_home.py +++ b/tests/components/google_assistant/test_smart_home.py @@ -686,7 +686,7 @@ async def test_device_class_cover(hass, device_class, google_type): @pytest.mark.parametrize("device_class,google_type", [ - ('non_existing_class', 'action.devices.types.MEDIA'), + ('non_existing_class', 'action.devices.types.SWITCH'), ('speaker', 'action.devices.types.SPEAKER'), ('tv', 'action.devices.types.TV'), ]) From 58f28f177d99158911888fee0b7b7070a383b7bc Mon Sep 17 00:00:00 2001 From: karlkar Date: Fri, 17 May 2019 06:29:52 +0200 Subject: [PATCH 04/12] Fix problem with cameras that don't support time (#23924) Some onvif cameras don't support Date management. In that case None is returned and script crashes when trying to obtain date --- homeassistant/components/onvif/camera.py | 35 ++++++++++++------------ 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/homeassistant/components/onvif/camera.py b/homeassistant/components/onvif/camera.py index ea3d0277136..68c3c819567 100644 --- a/homeassistant/components/onvif/camera.py +++ b/homeassistant/components/onvif/camera.py @@ -164,27 +164,28 @@ class ONVIFHassCamera(Camera): system_date = dt_util.utcnow() device_time = await devicemgmt.GetSystemDateAndTime() - cdate = device_time.UTCDateTime - cam_date = dt.datetime(cdate.Date.Year, cdate.Date.Month, - cdate.Date.Day, cdate.Time.Hour, - cdate.Time.Minute, cdate.Time.Second, - 0, dt_util.UTC) + if device_time: + cdate = device_time.UTCDateTime + cam_date = dt.datetime(cdate.Date.Year, cdate.Date.Month, + cdate.Date.Day, cdate.Time.Hour, + cdate.Time.Minute, cdate.Time.Second, + 0, dt_util.UTC) - _LOGGER.debug("Camera date/time: %s", - cam_date) + _LOGGER.debug("Camera date/time: %s", + cam_date) - _LOGGER.debug("System date/time: %s", - system_date) + _LOGGER.debug("System date/time: %s", + system_date) - dt_diff = cam_date - system_date - dt_diff_seconds = dt_diff.total_seconds() + dt_diff = cam_date - system_date + dt_diff_seconds = dt_diff.total_seconds() - if dt_diff_seconds > 5: - _LOGGER.warning("The date/time on the camera is '%s', " - "which is different from the system '%s', " - "this could lead to authentication issues", - cam_date, - system_date) + if dt_diff_seconds > 5: + _LOGGER.warning("The date/time on the camera is '%s', " + "which is different from the system '%s', " + "this could lead to authentication issues", + cam_date, + system_date) _LOGGER.debug("Obtaining input uri") From e12222697ce5096cf603ec095b3f6712605a3358 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 17 May 2019 06:35:20 +0200 Subject: [PATCH 05/12] Bumped version to 0.93.1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index e32ae1015d1..e5dcb7a7e02 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 93 -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) From c5bd6b3d6bcfbbe0c60ca79f7eaa025287f45371 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 17 May 2019 09:39:36 +0200 Subject: [PATCH 06/12] Fix auto version update Hass.io (#23935) --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ceccb39d5f0..5d518af1103 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -159,7 +159,7 @@ jobs: git config --global user.email "pvizeli@syshack.ch" git config --global credential.helper store - echo "https://$(githubToken):x-oauth-basic@github.com" > $HOME\.git-credentials + echo "https://$(githubToken):x-oauth-basic@github.com" > $HOME/.git-credentials displayName: 'Install requirements' - script: | set -e From 41b7f5ab1c70a902dd08d894d388401b7300ad0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Fri, 17 May 2019 15:56:04 +0200 Subject: [PATCH 07/12] Bump pytraccar (#23939) --- homeassistant/components/traccar/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/traccar/manifest.json b/homeassistant/components/traccar/manifest.json index 0f9aa6e8464..15b78d0ec7b 100644 --- a/homeassistant/components/traccar/manifest.json +++ b/homeassistant/components/traccar/manifest.json @@ -3,7 +3,7 @@ "name": "Traccar", "documentation": "https://www.home-assistant.io/components/traccar", "requirements": [ - "pytraccar==0.8.0", + "pytraccar==0.9.0", "stringcase==1.2.0" ], "dependencies": [], diff --git a/requirements_all.txt b/requirements_all.txt index 32e3aed15c2..d6e745227aa 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1450,7 +1450,7 @@ pytile==2.0.6 pytouchline==0.7 # homeassistant.components.traccar -pytraccar==0.8.0 +pytraccar==0.9.0 # homeassistant.components.trackr pytrackr==0.0.5 From f6e6c21ba637fb5a75d8a177fa4ad39cb089cac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sat, 18 May 2019 22:59:33 +0200 Subject: [PATCH 08/12] Fixes issue with multiple alerts (#23945) * Fixes issue with multiple alerts * Adds missing new line * Remove whitespace --- homeassistant/components/alert/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/alert/__init__.py b/homeassistant/components/alert/__init__.py index 4c990d62d4b..88217b026fd 100644 --- a/homeassistant/components/alert/__init__.py +++ b/homeassistant/components/alert/__init__.py @@ -1,7 +1,7 @@ """Support for repeating alerts when conditions are met.""" import asyncio import logging -from datetime import datetime, timedelta +from datetime import timedelta import voluptuous as vol @@ -13,6 +13,7 @@ from homeassistant.const import ( SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE, ATTR_ENTITY_ID) from homeassistant.helpers import service, event from homeassistant.helpers.entity import ToggleEntity +from homeassistant.util.dt import now _LOGGER = logging.getLogger(__name__) @@ -222,7 +223,7 @@ class Alert(ToggleEntity): async def _schedule_notify(self): """Schedule a notification.""" delay = self._delay[self._next_delay] - next_msg = datetime.now() + delay + next_msg = now() + delay self._cancel = \ event.async_track_point_in_time(self.hass, self._notify, next_msg) self._next_delay = min(self._next_delay + 1, len(self._delay) - 1) From 99c49c0993a93d0d8c256b88df9189143565e181 Mon Sep 17 00:00:00 2001 From: Julien Brochet Date: Sat, 18 May 2019 02:17:26 +0200 Subject: [PATCH 09/12] Setup integration dependencies before loading it (#23957) --- homeassistant/scripts/check_config.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/scripts/check_config.py b/homeassistant/scripts/check_config.py index 5fe4e95a480..9a273845887 100644 --- a/homeassistant/scripts/check_config.py +++ b/homeassistant/scripts/check_config.py @@ -338,12 +338,6 @@ async def check_ha_config_file(hass): result.add_error("Integration not found: {}".format(domain)) continue - try: - component = integration.get_component() - except ImportError: - result.add_error("Component not found: {}".format(domain)) - continue - if (not hass.config.skip_pip and integration.requirements and not await requirements.async_process_requirements( hass, integration.domain, integration.requirements)): @@ -351,6 +345,12 @@ async def check_ha_config_file(hass): ', '.join(integration.requirements))) continue + try: + component = integration.get_component() + except ImportError: + result.add_error("Component not found: {}".format(domain)) + continue + if hasattr(component, 'CONFIG_SCHEMA'): try: config = component.CONFIG_SCHEMA(config) From bf910ef383312303fd5b1c88ac5f5c103b68dc35 Mon Sep 17 00:00:00 2001 From: Cyro Date: Sat, 18 May 2019 22:14:54 +0200 Subject: [PATCH 10/12] Make Discord payload data key not required (#23964) --- homeassistant/components/discord/notify.py | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/discord/notify.py b/homeassistant/components/discord/notify.py index 5a9cb77877d..2e3d2eee9e9 100644 --- a/homeassistant/components/discord/notify.py +++ b/homeassistant/components/discord/notify.py @@ -53,21 +53,20 @@ class DiscordNotificationService(BaseNotificationService): _LOGGER.error("No target specified") return None - if ATTR_DATA in kwargs: - data = kwargs.get(ATTR_DATA) + data = kwargs.get(ATTR_DATA) or {} - if ATTR_IMAGES in data: - images = list() + if ATTR_IMAGES in data: + images = list() - for image in data.get(ATTR_IMAGES): - image_exists = await self.hass.async_add_executor_job( - self.file_exists, - image) + for image in data.get(ATTR_IMAGES): + image_exists = await self.hass.async_add_executor_job( + self.file_exists, + image) - if image_exists: - images.append(image) - else: - _LOGGER.warning("Image not found: %s", image) + if image_exists: + images.append(image) + else: + _LOGGER.warning("Image not found: %s", image) # pylint: disable=unused-variable @discord_bot.event From 70c5c8254190ea3cf7f2928f7fe5136526545f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sat, 18 May 2019 22:14:12 +0200 Subject: [PATCH 11/12] upgrade broadlink library (#23966) --- homeassistant/components/broadlink/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/broadlink/manifest.json b/homeassistant/components/broadlink/manifest.json index a2c565c3dd5..125a3a83d21 100644 --- a/homeassistant/components/broadlink/manifest.json +++ b/homeassistant/components/broadlink/manifest.json @@ -3,7 +3,7 @@ "name": "Broadlink", "documentation": "https://www.home-assistant.io/components/broadlink", "requirements": [ - "broadlink==0.9.0" + "broadlink==0.10.0" ], "dependencies": [], "codeowners": [ diff --git a/requirements_all.txt b/requirements_all.txt index d6e745227aa..10801833614 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -261,7 +261,7 @@ boto3==1.9.16 braviarc-homeassistant==0.3.7.dev0 # homeassistant.components.broadlink -broadlink==0.9.0 +broadlink==0.10.0 # homeassistant.components.brottsplatskartan brottsplatskartan==0.0.1 From 8d0b1588be23a792e6e3e4a3233e0dfa18e1499a Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 22 May 2019 20:00:34 -0700 Subject: [PATCH 12/12] Bumped version to 0.93.2 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index e5dcb7a7e02..458b90d8203 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 93 -PATCH_VERSION = '1' +PATCH_VERSION = '2' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3)