Skip to content

Commit

Permalink
Merge pull request #24828 from home-assistant/rc
Browse files Browse the repository at this point in the history
0.95.2
  • Loading branch information
balloob authored Jun 28, 2019
2 parents 5598f05 + 6cbfc63 commit 0871d6c
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 26 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ trigger:
pr: none
variables:
- name: versionBuilder
value: '4.2'
value: '4.5'
- group: docker
- group: github
- group: twine
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/google_assistant/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def agent_user_id(self):
@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):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/life360/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ def _update_members(self, members, members_updated):
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')
Expand All @@ -318,6 +317,7 @@ def _update_members(self, members, members_updated):
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):
Expand Down
42 changes: 23 additions & 19 deletions homeassistant/components/netatmo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
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 = []
Expand Down Expand Up @@ -132,7 +138,14 @@ def _retry(_data):

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()
Expand All @@ -157,18 +170,11 @@ def _retry(_data):
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


Expand All @@ -187,12 +193,11 @@ def __init__(self, netatmo_data, module_name, sensor_type, station):
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):
Expand Down Expand Up @@ -515,15 +520,14 @@ def __init__(self, auth, data_class, station):
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.
Expand Down
7 changes: 6 additions & 1 deletion homeassistant/components/script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,14 @@ async def turn_on_service(service):
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):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/zha/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions tests/components/script/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

0 comments on commit 0871d6c

Please sign in to comment.