diff --git a/azure-pipelines-release.yml b/azure-pipelines-release.yml index d6395dad5ac..af737290143 100644 --- a/azure-pipelines-release.yml +++ b/azure-pipelines-release.yml @@ -8,7 +8,7 @@ trigger: pr: none variables: - name: versionBuilder - value: '4.2' + value: '4.5' - group: docker - group: github - group: twine diff --git a/homeassistant/components/google_assistant/http.py b/homeassistant/components/google_assistant/http.py index 95528eea3ca..8f6d441d498 100644 --- a/homeassistant/components/google_assistant/http.py +++ b/homeassistant/components/google_assistant/http.py @@ -37,7 +37,7 @@ class GoogleConfig(AbstractConfig): @property def entity_config(self): """Return entity config.""" - return self._config.get(CONF_ENTITY_CONFIG, {}) + return self._config.get(CONF_ENTITY_CONFIG) or {} @property def secure_devices_pin(self): diff --git a/homeassistant/components/life360/device_tracker.py b/homeassistant/components/life360/device_tracker.py index 4329f2a162b..abf97ffa7b8 100644 --- a/homeassistant/components/life360/device_tracker.py +++ b/homeassistant/components/life360/device_tracker.py @@ -294,7 +294,6 @@ class Life360Scanner: member_id = member['id'] if member_id in members_updated: continue - members_updated.append(member_id) err_key = 'Member data' try: first = member.get('firstName') @@ -318,6 +317,7 @@ class Life360Scanner: self._ok(err_key) if include_member and sharing: + members_updated.append(member_id) self._update_member(member, dev_id) def _update_life360(self, now=None): diff --git a/homeassistant/components/netatmo/sensor.py b/homeassistant/components/netatmo/sensor.py index 48d82eca2f0..9902fedde8f 100644 --- a/homeassistant/components/netatmo/sensor.py +++ b/homeassistant/components/netatmo/sensor.py @@ -99,6 +99,12 @@ MODULE_TYPE_RAIN = 'NAModule3' MODULE_TYPE_INDOOR = 'NAModule4' +NETATMO_DEVICE_TYPES = { + 'WeatherStationData': 'weather station', + 'HomeCoachData': 'home coach' +} + + def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the available Netatmo weather sensors.""" dev = [] @@ -132,7 +138,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None): import pyatmo for data_class in [pyatmo.WeatherStationData, pyatmo.HomeCoachData]: - data = NetatmoData(auth, data_class, config.get(CONF_STATION)) + try: + data = NetatmoData(auth, data_class, config.get(CONF_STATION)) + except pyatmo.NoDevice: + _LOGGER.warning( + "No %s devices found", + NETATMO_DEVICE_TYPES[data_class.__name__] + ) + continue # Test if manually configured if CONF_MODULES in config: module_items = config[CONF_MODULES].items() @@ -157,18 +170,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None): def find_devices(data): """Find all devices.""" dev = [] - not_handled = [] - for module_name in data.get_module_names(): - if (module_name not in data.get_module_names() - and module_name not in not_handled): - not_handled.append(not_handled) - continue + module_names = data.get_module_names() + for module_name in module_names: for condition in data.station_data.monitoredConditions(module_name): dev.append(NetatmoSensor( data, module_name, condition.lower(), data.station)) - - for module_name in not_handled: - _LOGGER.error('Module name: "%s" not found', module_name) return dev @@ -187,12 +193,11 @@ class NetatmoSensor(Entity): self._device_class = SENSOR_TYPES[self.type][3] self._icon = SENSOR_TYPES[self.type][2] self._unit_of_measurement = SENSOR_TYPES[self.type][1] - self._module_type = self.netatmo_data. \ - station_data.moduleByName(module=module_name)['type'] - module_id = self.netatmo_data. \ - station_data.moduleByName(station=self.station_name, - module=module_name)['_id'] - self._unique_id = '{}-{}'.format(module_id, self.type) + module = self.netatmo_data.station_data.moduleByName( + station=self.station_name, module=module_name + ) + self._module_type = module['type'] + self._unique_id = '{}-{}'.format(module['_id'], self.type) @property def name(self): @@ -515,15 +520,14 @@ class NetatmoData: self.auth = auth self.data_class = data_class self.data = {} - self.station_data = None + self.station_data = self.data_class(self.auth) self.station = station self._next_update = time() self._update_in_progress = threading.Lock() def get_module_names(self): """Return all module available on the API as a list.""" - self.update() - return self.data.keys() + return self.station_data.modulesNamesList() def update(self): """Call the Netatmo API to update the data. diff --git a/homeassistant/components/script/__init__.py b/homeassistant/components/script/__init__.py index 36cb144fada..495df2c5e17 100644 --- a/homeassistant/components/script/__init__.py +++ b/homeassistant/components/script/__init__.py @@ -79,9 +79,14 @@ async def async_setup(hass, config): async def turn_off_service(service): """Cancel a script.""" # Stopping a script is ok to be done in parallel + scripts = await component.async_extract_from_service(service) + + if not scripts: + return + await asyncio.wait([ script.async_turn_off() for script - in await component.async_extract_from_service(service) + in scripts ]) async def toggle_service(service): diff --git a/homeassistant/components/zha/manifest.json b/homeassistant/components/zha/manifest.json index 15fcf38100f..7f067353b37 100644 --- a/homeassistant/components/zha/manifest.json +++ b/homeassistant/components/zha/manifest.json @@ -5,7 +5,7 @@ "documentation": "https://www.home-assistant.io/components/zha", "requirements": [ "bellows-homeassistant==0.8.2", - "zha-quirks==0.0.15", + "zha-quirks==0.0.17", "zigpy-deconz==0.1.6", "zigpy-homeassistant==0.6.1", "zigpy-xbee-homeassistant==0.3.0" diff --git a/homeassistant/const.py b/homeassistant/const.py index de5dac85c8f..2345c5fbe63 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -2,7 +2,7 @@ """Constants used by Home Assistant components.""" MAJOR_VERSION = 0 MINOR_VERSION = 95 -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) diff --git a/requirements_all.txt b/requirements_all.txt index e763a02b754..081f357b52c 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1917,7 +1917,7 @@ zengge==0.2 zeroconf==0.23.0 # homeassistant.components.zha -zha-quirks==0.0.15 +zha-quirks==0.0.17 # homeassistant.components.zhong_hong zhong_hong_hvac==1.0.9 diff --git a/tests/components/script/test_init.py b/tests/components/script/test_init.py index c2ff17d9444..9e0b751c430 100644 --- a/tests/components/script/test_init.py +++ b/tests/components/script/test_init.py @@ -322,3 +322,13 @@ async def test_logging_script_error(hass, caplog): assert err.value.domain == 'non' assert err.value.service == 'existing' assert 'Error executing script' in caplog.text + + +async def test_turning_no_scripts_off(hass): + """Test it is possible to turn two scripts off.""" + assert await async_setup_component(hass, 'script', {}) + + # Testing it doesn't raise + await hass.services.async_call( + DOMAIN, SERVICE_TURN_OFF, {'entity_id': []}, blocking=True + )