Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Add warning if no device id is set
Browse files Browse the repository at this point in the history
  • Loading branch information
belak committed May 10, 2017
1 parent 81650a9 commit 964b4d3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mopidy_gmusic/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ def on_start(self):
self.config['gmusic']['password'],
self.config['gmusic']['deviceid'])

if not self.config['gmusic']['deviceid']:
logger.warn('There is no gmusic deviceid set. Mopidy will fall back to the MAC address of this device. Registered devices are listed below.')
for device in self.session.api.get_registered_devices():
deviceid = device['id']
if deviceid.startswith('ios:'):
deviceid = deviceid[4:]
elif deviceid.startswith('0x'):
deviceid = deviceid[2:]
logger.info('Name: %s, ID: %s', device.get('friendlyName', 'Unknown Device'), deviceid)

# wait a few seconds to let mopidy settle
# then refresh google music content asynchronously
self._refresh_library_timer = RepeatingTimer(
Expand Down

0 comments on commit 964b4d3

Please sign in to comment.