From 07b7d7b07470d221ff6512ed185268a554c2d044 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 8 May 2019 20:22:36 -0700 Subject: [PATCH 01/25] Bumped version to 0.93.0b0 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 9176c1b8939..56af5dbbf4e 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.dev0' +PATCH_VERSION = '0b0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 01578f78f12f5159ffbcf061cfd876969c2ff630 Mon Sep 17 00:00:00 2001 From: Steven Looman Date: Fri, 10 May 2019 01:17:47 +0200 Subject: [PATCH 02/25] Sort discovered entries by 'st' to ensure getting the same device each discovery (#23763) --- homeassistant/components/upnp/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/upnp/__init__.py b/homeassistant/components/upnp/__init__.py index 01f6d6159f0..fd2aa994ca4 100644 --- a/homeassistant/components/upnp/__init__.py +++ b/homeassistant/components/upnp/__init__.py @@ -1,5 +1,6 @@ """Open ports in your router for Home Assistant and provide statistics.""" from ipaddress import ip_address +from operator import itemgetter import voluptuous as vol @@ -88,6 +89,8 @@ async def async_discover_and_construct(hass, udn=None) -> Device: _LOGGER.warning('Wanted UPnP/IGD device with UDN "%s" not found, ' 'aborting', udn) return None + # ensure we're always taking the latest + filtered = sorted(filtered, key=itemgetter('st'), reverse=True) discovery_info = filtered[0] else: # get the first/any From 0caa27094edf06131b07052a8c4558137a838cc0 Mon Sep 17 00:00:00 2001 From: cgtobi Date: Thu, 9 May 2019 06:08:07 +0200 Subject: [PATCH 03/25] Bump pyatmo to v1.11 (#23766) --- homeassistant/components/netatmo/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/netatmo/manifest.json b/homeassistant/components/netatmo/manifest.json index c7e91d645fc..a5e4e8aa7a7 100644 --- a/homeassistant/components/netatmo/manifest.json +++ b/homeassistant/components/netatmo/manifest.json @@ -3,7 +3,7 @@ "name": "Netatmo", "documentation": "https://www.home-assistant.io/components/netatmo", "requirements": [ - "pyatmo==1.10" + "pyatmo==1.11" ], "dependencies": [ "webhook" diff --git a/requirements_all.txt b/requirements_all.txt index 552bad7b31b..db555dab405 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -976,7 +976,7 @@ pyalarmdotcom==0.3.2 pyarlo==0.2.3 # homeassistant.components.netatmo -pyatmo==1.10 +pyatmo==1.11 # homeassistant.components.apple_tv pyatv==0.3.12 From e6c5cc92d1a6cf4e1cba6a8c03c61c4d8032c741 Mon Sep 17 00:00:00 2001 From: dreed47 Date: Thu, 9 May 2019 23:18:28 -0400 Subject: [PATCH 04/25] Fix for issue #23739. Added unique_id property so (#23769) that entities will always get mapped to the same property ZPID code. --- homeassistant/components/zestimate/sensor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/zestimate/sensor.py b/homeassistant/components/zestimate/sensor.py index 036422d6800..cb823dab0de 100644 --- a/homeassistant/components/zestimate/sensor.py +++ b/homeassistant/components/zestimate/sensor.py @@ -66,6 +66,11 @@ class ZestimateDataSensor(Entity): self.data = None self.address = None self._state = None + + @property + def unique_id(self): + """Return the ZPID.""" + return self.params['zpid'] @property def name(self): From d5533cc10fefdffbb67d44b43b6727adb51de308 Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Thu, 9 May 2019 23:17:56 -0400 Subject: [PATCH 05/25] Beta Fix: ONVIF (#23787) * bump package to include wsdl * update requirements all --- homeassistant/components/onvif/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/onvif/manifest.json b/homeassistant/components/onvif/manifest.json index 177a8e1eabd..f36a5cf4b1a 100644 --- a/homeassistant/components/onvif/manifest.json +++ b/homeassistant/components/onvif/manifest.json @@ -3,7 +3,7 @@ "name": "Onvif", "documentation": "https://www.home-assistant.io/components/onvif", "requirements": [ - "onvif-zeep-async==0.1.2" + "onvif-zeep-async==0.1.3" ], "dependencies": [ "ffmpeg" diff --git a/requirements_all.txt b/requirements_all.txt index db555dab405..87b6e879ad5 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -797,7 +797,7 @@ oemthermostat==1.1 onkyo-eiscp==1.2.4 # homeassistant.components.onvif -onvif-zeep-async==0.1.2 +onvif-zeep-async==0.1.3 # homeassistant.components.openevse openevsewifi==0.4 From f17259c70585b82ec5c9198a3765640804533e45 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 9 May 2019 15:49:12 -0700 Subject: [PATCH 06/25] Updated frontend to 20190509.0 --- homeassistant/components/frontend/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/manifest.json b/homeassistant/components/frontend/manifest.json index 44d42955269..559469c63ac 100644 --- a/homeassistant/components/frontend/manifest.json +++ b/homeassistant/components/frontend/manifest.json @@ -3,7 +3,7 @@ "name": "Home Assistant Frontend", "documentation": "https://www.home-assistant.io/components/frontend", "requirements": [ - "home-assistant-frontend==20190508.0" + "home-assistant-frontend==20190509.0" ], "dependencies": [ "api", diff --git a/requirements_all.txt b/requirements_all.txt index 87b6e879ad5..aded56852b3 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -563,7 +563,7 @@ hole==0.3.0 holidays==0.9.10 # homeassistant.components.frontend -home-assistant-frontend==20190508.0 +home-assistant-frontend==20190509.0 # homeassistant.components.zwave homeassistant-pyozw==0.1.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index fbf5a701072..2d138a9910d 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -145,7 +145,7 @@ hdate==0.8.7 holidays==0.9.10 # homeassistant.components.frontend -home-assistant-frontend==20190508.0 +home-assistant-frontend==20190509.0 # homeassistant.components.homekit_controller homekit[IP]==0.14.0 From 61ed604fdab1247c03938ab89ba690aa1ef81b8a Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 10 May 2019 06:17:26 +0000 Subject: [PATCH 07/25] Bump version 0.93.0b1 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 56af5dbbf4e..0227e013f09 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 = '0b0' +PATCH_VERSION = '0b1' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 2d724f5cc982e8632f621f2aed58f9f62cefd440 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 10 May 2019 14:22:38 -0700 Subject: [PATCH 08/25] Updated frontend to 20190510.0 --- homeassistant/components/frontend/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/manifest.json b/homeassistant/components/frontend/manifest.json index 559469c63ac..082bc6328d0 100644 --- a/homeassistant/components/frontend/manifest.json +++ b/homeassistant/components/frontend/manifest.json @@ -3,7 +3,7 @@ "name": "Home Assistant Frontend", "documentation": "https://www.home-assistant.io/components/frontend", "requirements": [ - "home-assistant-frontend==20190509.0" + "home-assistant-frontend==20190510.0" ], "dependencies": [ "api", diff --git a/requirements_all.txt b/requirements_all.txt index aded56852b3..b19f883a073 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -563,7 +563,7 @@ hole==0.3.0 holidays==0.9.10 # homeassistant.components.frontend -home-assistant-frontend==20190509.0 +home-assistant-frontend==20190510.0 # homeassistant.components.zwave homeassistant-pyozw==0.1.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 2d138a9910d..34f40a39bbf 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -145,7 +145,7 @@ hdate==0.8.7 holidays==0.9.10 # homeassistant.components.frontend -home-assistant-frontend==20190509.0 +home-assistant-frontend==20190510.0 # homeassistant.components.homekit_controller homekit[IP]==0.14.0 From d4f79fc88a1dbac96a4201f311098e28e36ab538 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Fri, 10 May 2019 22:37:03 +0200 Subject: [PATCH 09/25] Synchronize Sonos service calls (#23791) --- homeassistant/components/sonos/__init__.py | 6 ++++++ homeassistant/components/sonos/media_player.py | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sonos/__init__.py b/homeassistant/components/sonos/__init__.py index d0e467f6964..5f7b2d04431 100644 --- a/homeassistant/components/sonos/__init__.py +++ b/homeassistant/components/sonos/__init__.py @@ -1,4 +1,5 @@ """Support to embed Sonos.""" +import asyncio import voluptuous as vol from homeassistant import config_entries @@ -80,12 +81,15 @@ SONOS_SET_OPTION_SCHEMA = vol.Schema({ vol.Optional(ATTR_SPEECH_ENHANCE): cv.boolean, }) +DATA_SERVICE_EVENT = 'sonos_service_idle' + async def async_setup(hass, config): """Set up the Sonos component.""" conf = config.get(DOMAIN) hass.data[DOMAIN] = conf or {} + hass.data[DATA_SERVICE_EVENT] = asyncio.Event() if conf is not None: hass.async_create_task(hass.config_entries.flow.async_init( @@ -93,7 +97,9 @@ async def async_setup(hass, config): async def service_handle(service): """Dispatch a service call.""" + hass.data[DATA_SERVICE_EVENT].clear() async_dispatcher_send(hass, DOMAIN, service.service, service.data) + await hass.data[DATA_SERVICE_EVENT].wait() hass.services.async_register( DOMAIN, SERVICE_JOIN, service_handle, diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index 524353f8c54..5d1cd138260 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -25,7 +25,7 @@ from homeassistant.util.dt import utcnow from . import ( CONF_ADVERTISE_ADDR, CONF_HOSTS, CONF_INTERFACE_ADDR, - DOMAIN as SONOS_DOMAIN, + DATA_SERVICE_EVENT, DOMAIN as SONOS_DOMAIN, ATTR_ALARM_ID, ATTR_ENABLED, ATTR_INCLUDE_LINKED_ZONES, ATTR_MASTER, ATTR_NIGHT_SOUND, ATTR_SLEEP_TIME, ATTR_SPEECH_ENHANCE, ATTR_TIME, ATTR_VOLUME, ATTR_WITH_GROUP, @@ -155,6 +155,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities): hass.async_add_executor_job(call, data) + # We are ready for the next service call + hass.data[DATA_SERVICE_EVENT].set() + async_dispatcher_connect(hass, SONOS_DOMAIN, async_service_handle) From 6d40980de1ea8879eb5b625c45a08c5efc2ef731 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 10 May 2019 14:32:51 -0700 Subject: [PATCH 10/25] Bumped version to 0.93.0b2 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 0227e013f09..f2e998579f6 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 = '0b1' +PATCH_VERSION = '0b2' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 9b12dd66e4a1c23d90014cd66260689d57522b1d Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 14 May 2019 07:07:56 +0200 Subject: [PATCH 11/25] Updated frontend to 20190514.0 --- homeassistant/components/frontend/manifest.json | 2 +- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/manifest.json b/homeassistant/components/frontend/manifest.json index 082bc6328d0..45b1f0ff351 100644 --- a/homeassistant/components/frontend/manifest.json +++ b/homeassistant/components/frontend/manifest.json @@ -3,7 +3,7 @@ "name": "Home Assistant Frontend", "documentation": "https://www.home-assistant.io/components/frontend", "requirements": [ - "home-assistant-frontend==20190510.0" + "home-assistant-frontend==20190514.0" ], "dependencies": [ "api", diff --git a/requirements_all.txt b/requirements_all.txt index b19f883a073..a3466860a25 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -563,7 +563,7 @@ hole==0.3.0 holidays==0.9.10 # homeassistant.components.frontend -home-assistant-frontend==20190510.0 +home-assistant-frontend==20190514.0 # homeassistant.components.zwave homeassistant-pyozw==0.1.4 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 34f40a39bbf..a91d382fe80 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -145,7 +145,7 @@ hdate==0.8.7 holidays==0.9.10 # homeassistant.components.frontend -home-assistant-frontend==20190510.0 +home-assistant-frontend==20190514.0 # homeassistant.components.homekit_controller homekit[IP]==0.14.0 From 93ad7b2e45f1149e588bbe9d22e3e3a29444d13a Mon Sep 17 00:00:00 2001 From: Alexei Chetroi Date: Fri, 10 May 2019 18:57:08 -0400 Subject: [PATCH 12/25] Do not add coordinator to the ZHA entities. (#23803) --- homeassistant/components/zha/core/gateway.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/zha/core/gateway.py b/homeassistant/components/zha/core/gateway.py index 4a16bfe5004..daf14297ec1 100644 --- a/homeassistant/components/zha/core/gateway.py +++ b/homeassistant/components/zha/core/gateway.py @@ -93,6 +93,8 @@ class ZHAGateway: init_tasks = [] for device in self.application_controller.devices.values(): + if device.nwk == 0x0000: + continue init_tasks.append(self.async_device_initialized(device, False)) await asyncio.gather(*init_tasks) From 04720175b98adf220a9d5b06cb8f113912a1cc37 Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Sat, 11 May 2019 02:15:21 -0400 Subject: [PATCH 13/25] fix onvif wsdl import - take 2 (#23807) --- homeassistant/components/onvif/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/onvif/manifest.json b/homeassistant/components/onvif/manifest.json index f36a5cf4b1a..d86ec38ccb7 100644 --- a/homeassistant/components/onvif/manifest.json +++ b/homeassistant/components/onvif/manifest.json @@ -3,7 +3,7 @@ "name": "Onvif", "documentation": "https://www.home-assistant.io/components/onvif", "requirements": [ - "onvif-zeep-async==0.1.3" + "onvif-zeep-async==0.2.0" ], "dependencies": [ "ffmpeg" diff --git a/requirements_all.txt b/requirements_all.txt index a3466860a25..b6fd6ac15d2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -797,7 +797,7 @@ oemthermostat==1.1 onkyo-eiscp==1.2.4 # homeassistant.components.onvif -onvif-zeep-async==0.1.3 +onvif-zeep-async==0.2.0 # homeassistant.components.openevse openevsewifi==0.4 From 3d821b91481941c76ec3b35d235beedd693f292f Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Tue, 14 May 2019 01:16:41 -0400 Subject: [PATCH 14/25] Correct ZHA illumination conversion (#23853) * fix illumination values * correct formula * update illuminance calculation * update test --- homeassistant/components/zha/sensor.py | 8 ++++++++ tests/components/zha/test_sensor.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/zha/sensor.py b/homeassistant/components/zha/sensor.py index 94f57ed9a0b..b2d246c3095 100644 --- a/homeassistant/components/zha/sensor.py +++ b/homeassistant/components/zha/sensor.py @@ -24,6 +24,13 @@ def pass_through_formatter(value): return value +def illuminance_formatter(value): + """Convert Illimination data.""" + if value is None: + return None + return round(pow(10, ((value - 1) / 10000)), 1) + + def temperature_formatter(value): """Convert temperature data.""" if value is None: @@ -58,6 +65,7 @@ FORMATTER_FUNC_REGISTRY = { TEMPERATURE: temperature_formatter, PRESSURE: pressure_formatter, ELECTRICAL_MEASUREMENT: active_power_formatter, + ILLUMINANCE: illuminance_formatter, GENERIC: pass_through_formatter, } diff --git a/tests/components/zha/test_sensor.py b/tests/components/zha/test_sensor.py index ec6af7f4aa1..cd8f4ba72b2 100644 --- a/tests/components/zha/test_sensor.py +++ b/tests/components/zha/test_sensor.py @@ -139,7 +139,7 @@ async def async_test_pressure(hass, device_info): async def async_test_illuminance(hass, device_info): """Test illuminance sensor.""" await send_attribute_report(hass, device_info["cluster"], 0, 10) - assert_state(hass, device_info, '10', 'lx') + assert_state(hass, device_info, '1.0', 'lx') async def async_test_metering(hass, device_info): From 8ba2ab567ee883013a6b256efc30ef20d58f0d79 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Tue, 14 May 2019 01:16:21 -0400 Subject: [PATCH 15/25] Fix ZHA battery when readings produce an unknown value (#23854) * check for unknown readings * only publish valid readings * remove unused constant --- homeassistant/components/zha/device_entity.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zha/device_entity.py b/homeassistant/components/zha/device_entity.py index 3937e597b78..94fe598b6ec 100644 --- a/homeassistant/components/zha/device_entity.py +++ b/homeassistant/components/zha/device_entity.py @@ -142,8 +142,8 @@ class ZhaDeviceEntity(ZhaEntity): """Get the latest battery reading from channels cache.""" battery = await self._battery_channel.get_attribute_value( 'battery_percentage_remaining') - if battery is not None: - # per zcl specs battery percent is reported at 200% ¯\_(ツ)_/¯ + # per zcl specs battery percent is reported at 200% ¯\_(ツ)_/¯ + if battery is not None and battery != -1: battery = battery / 2 battery = int(round(battery)) self._device_state_attributes['battery_level'] = battery From 4dd8423b9bf438c742e710c11fad9a362396fabe Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Tue, 14 May 2019 01:15:31 -0400 Subject: [PATCH 16/25] bump zha-quirks (#23855) --- homeassistant/components/zha/manifest.json | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/zha/manifest.json b/homeassistant/components/zha/manifest.json index a8b459e9e96..9f1f69a11ec 100644 --- a/homeassistant/components/zha/manifest.json +++ b/homeassistant/components/zha/manifest.json @@ -4,7 +4,7 @@ "documentation": "https://www.home-assistant.io/components/zha", "requirements": [ "bellows-homeassistant==0.7.3", - "zha-quirks==0.0.12", + "zha-quirks==0.0.13", "zigpy-deconz==0.1.4", "zigpy-homeassistant==0.3.3", "zigpy-xbee-homeassistant==0.2.1" diff --git a/requirements_all.txt b/requirements_all.txt index b6fd6ac15d2..32e3aed15c2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1851,7 +1851,7 @@ zengge==0.2 zeroconf==0.22.0 # homeassistant.components.zha -zha-quirks==0.0.12 +zha-quirks==0.0.13 # homeassistant.components.zhong_hong zhong_hong_hvac==1.0.9 From f083abbed118fe9aaf05f6a90a23035e170616d7 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 14 May 2019 07:19:37 +0200 Subject: [PATCH 17/25] Bumped version to 0.93.0b3 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index f2e998579f6..c293542b664 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 = '0b2' +PATCH_VERSION = '0b3' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From b79886ad8582d0eab97ea1a63f3fa44888cbe441 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Tue, 14 May 2019 02:12:05 -0500 Subject: [PATCH 18/25] Fix improper usage of body attribute on web.Response. Should be text since we arent sending bytes (#23857) --- homeassistant/components/geofency/__init__.py | 2 +- homeassistant/components/locative/__init__.py | 4 ++-- homeassistant/components/mobile_app/helpers.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/geofency/__init__.py b/homeassistant/components/geofency/__init__.py index 0b4b757ce9e..57eaf5393ae 100644 --- a/homeassistant/components/geofency/__init__.py +++ b/homeassistant/components/geofency/__init__.py @@ -72,7 +72,7 @@ async def handle_webhook(hass, webhook_id, request): data = WEBHOOK_SCHEMA(dict(await request.post())) except vol.MultipleInvalid as error: return web.Response( - body=error.error_message, + text=error.error_message, status=HTTP_UNPROCESSABLE_ENTITY ) diff --git a/homeassistant/components/locative/__init__.py b/homeassistant/components/locative/__init__.py index f21c55af28a..50e6f69b0bd 100644 --- a/homeassistant/components/locative/__init__.py +++ b/homeassistant/components/locative/__init__.py @@ -58,7 +58,7 @@ async def handle_webhook(hass, webhook_id, request): data = WEBHOOK_SCHEMA(dict(await request.post())) except vol.MultipleInvalid as error: return web.Response( - body=error.error_message, + text=error.error_message, status=HTTP_UNPROCESSABLE_ENTITY ) @@ -76,7 +76,7 @@ async def handle_webhook(hass, webhook_id, request): location_name ) return web.Response( - body='Setting location to {}'.format(location_name), + text='Setting location to {}'.format(location_name), status=HTTP_OK ) diff --git a/homeassistant/components/mobile_app/helpers.py b/homeassistant/components/mobile_app/helpers.py index ee593588ef8..6aec4307464 100644 --- a/homeassistant/components/mobile_app/helpers.py +++ b/homeassistant/components/mobile_app/helpers.py @@ -81,7 +81,7 @@ def registration_context(registration: Dict) -> Context: def empty_okay_response(headers: Dict = None, status: int = 200) -> Response: """Return a Response with empty JSON object and a 200.""" - return Response(body='{}', status=status, content_type='application/json', + return Response(text='{}', status=status, content_type='application/json', headers=headers) From bde5a9ef01ce79acc019c7b1dc91c96753427ee0 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 14 May 2019 13:12:30 +0200 Subject: [PATCH 19/25] Bumped version to 0.93.0b4 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index c293542b664..3738b00b982 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 = '0b3' +PATCH_VERSION = '0b4' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 421b2962c626ae87c11be938d5d55e8fdb49ac47 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 14 May 2019 13:18:36 +0200 Subject: [PATCH 20/25] Bumped version to 0.93.0 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 3738b00b982..e32ae1015d1 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 = '0b4' +PATCH_VERSION = '0' __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) From 80ae02cc4977ad08d86ccf461d0f7cb9b90685b4 Mon Sep 17 00:00:00 2001 From: damarco Date: Mon, 13 May 2019 19:13:57 +0200 Subject: [PATCH 21/25] Fix zha timed off (#23849) --- homeassistant/components/zha/core/channels/general.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/zha/core/channels/general.py b/homeassistant/components/zha/core/channels/general.py index 031eb2464da..470cd6b38cf 100644 --- a/homeassistant/components/zha/core/channels/general.py +++ b/homeassistant/components/zha/core/channels/general.py @@ -27,6 +27,7 @@ class OnOffChannel(ZigbeeChannel): """Initialize OnOffChannel.""" super().__init__(cluster, device) self._state = None + self._off_listener = None @callback def cluster_command(self, tsn, command_id, args): @@ -48,9 +49,12 @@ class OnOffChannel(ZigbeeChannel): on_time = args[1] # 0 is always accept 1 is only accept when already on if should_accept == 0 or (should_accept == 1 and self._state): + if self._off_listener is not None: + self._off_listener() + self._off_listener = None self.attribute_updated(self.ON_OFF, True) if on_time > 0: - async_call_later( + self._off_listener = async_call_later( self.device.hass, (on_time / 10), # value is in 10ths of a second self.set_to_off @@ -61,6 +65,7 @@ class OnOffChannel(ZigbeeChannel): @callback def set_to_off(self, *_): """Set the state to off.""" + self._off_listener = None self.attribute_updated(self.ON_OFF, False) @callback From 3f841a36a50a5171a806f1978e19eaf74955b940 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Tue, 14 May 2019 10:18:01 +0200 Subject: [PATCH 22/25] Update azure-pipelines.yml for Azure Pipelines Automated version updates --- azure-pipelines.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0ca9425d002..fd45c334cf3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,6 +16,7 @@ variables: value: '0.3' - group: docker - group: wheels + - group: github jobs: @@ -141,3 +142,45 @@ jobs: -r https://github.com/home-assistant/hassio-homeassistant \ -t machine --docker-hub homeassistant displayName: 'Build Release' + + +- job: 'ReleasePublish' + condition: and(startsWith(variables['Build.SourceBranch'], 'refs/tags'), succeeded('Release')) + dependsOn: + - 'Release' + pool: + vmImage: 'ubuntu-16.04' + steps: + - script: | + sudo apt-get install -y --no-install-recommends \ + git jq + + git config --global user.name "Pascal Vizeli" + 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 + displayName: 'Install requirements' + - script: | + set -e + + version="$(Build.SourceBranchName)" + + git clone https://github.com/home-assistant/hassio-version + cd hassio-version + + dev_version="$(jq --raw-output '.homeassistant.default' dev.json)" + beta_version="$(jq --raw-output '.homeassistant.default' beta.json)" + stable_version="$(jq --raw-output '.homeassistant.default' stable.json)" + + if [[ "$version" =~ b ]]; then + sed -i "s|$dev_version|$version|g" dev.json + sed -i "s|$beta_version|$version|g" beta.json + else + sed -i "s|$dev_version|$version|g" dev.json + sed -i "s|$beta_version|$version|g" beta.json + sed -i "s|$stable_version|$version|g" stable.json + fi + + git commit -am "Bump Home Assistant $version" + git push From 177594f02c26a98d52145c9bbfaedeb48ecc30cf Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 9 May 2019 22:01:37 -0700 Subject: [PATCH 23/25] Update sensor.py --- homeassistant/components/zestimate/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/zestimate/sensor.py b/homeassistant/components/zestimate/sensor.py index cb823dab0de..10467b20cfa 100644 --- a/homeassistant/components/zestimate/sensor.py +++ b/homeassistant/components/zestimate/sensor.py @@ -66,7 +66,7 @@ class ZestimateDataSensor(Entity): self.data = None self.address = None self._state = None - + @property def unique_id(self): """Return the ZPID.""" From 6aa9844f8f2629c9d5db1a9d540ee70c78fc3177 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 15 May 2019 16:27:41 +0200 Subject: [PATCH 24/25] Fix auto discovery if the monitor condition (#23880) --- homeassistant/components/netatmo/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/netatmo/sensor.py b/homeassistant/components/netatmo/sensor.py index 046bf5c57f8..7b71eaf659c 100644 --- a/homeassistant/components/netatmo/sensor.py +++ b/homeassistant/components/netatmo/sensor.py @@ -145,7 +145,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None): # Only create sensors for monitored properties for condition in monitored_conditions: dev.append(NetatmoSensor( - data, module_name, condition)) + data, module_name, condition.lower())) for module_name, _ in not_handled.items(): _LOGGER.error('Module name: "%s" not found', module_name) From 0f140751b21dcbd410f48b0efb45fbe77d0ec87f Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 16 May 2019 05:43:19 +0200 Subject: [PATCH 25/25] Fix PS4 blocking startup (#23893) --- homeassistant/components/ps4/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/homeassistant/components/ps4/__init__.py b/homeassistant/components/ps4/__init__.py index dca1142db7a..b91e6b239e7 100644 --- a/homeassistant/components/ps4/__init__.py +++ b/homeassistant/components/ps4/__init__.py @@ -73,7 +73,6 @@ async def async_migrate_entry(hass, entry): # Remove old entity entry. registry.async_remove(entity_id) - await hass.async_block_till_done() # Format old unique_id. unique_id = format_unique_id(entry.data[CONF_TOKEN], unique_id)