async_query returns False if connection to server failed, handle this properly (#9070)

pull/9079/head
Erik Eriksson 2017-08-22 07:09:11 +02:00 committed by Pascal Vizeli
parent 8ceeee032c
commit 398735c9be
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ class LogitechMediaServer(object):
"""Create a list of devices connected to LMS."""
result = []
data = yield from self.async_query('players', 'status')
if data is False:
return result
for players in data.get('players_loop', []):
player = SqueezeBoxDevice(
self, players['playerid'], players['name'])