* SongPal: error handling if active_source can't be detected * sonpal: Add comment to the use of getattr() for property source * songpal: make comment single-line
This commit is contained in:
parent
7038dd484a
commit
0be922dc9c
1 changed files with 2 additions and 1 deletions
|
@ -288,7 +288,8 @@ class SongpalDevice(MediaPlayerDevice):
|
|||
@property
|
||||
def source(self):
|
||||
"""Return currently active source."""
|
||||
return self._active_source.title
|
||||
# Avoid a KeyError when _active_source is not (yet) populated
|
||||
return getattr(self._active_source, 'title', None)
|
||||
|
||||
@property
|
||||
def volume_level(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue