Skip to content

Commit

Permalink
fix(bluetooth): ensure source attribute is valid member of source list
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Aug 31, 2019
1 parent 6f71f50 commit 4ebc313
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/alexa_media/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ async def _get_source(self):
source = 'Local Speaker'
if self._bluetooth_state['pairedDeviceList'] is not None:
for device in self._bluetooth_state['pairedDeviceList']:
if device['connected'] is True:
if (device['connected'] is True and
device['friendlyName'] in self.source_list):
return device['friendlyName']
return source

Expand Down

0 comments on commit 4ebc313

Please sign in to comment.