mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
* 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
@ -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…
x
Reference in New Issue
Block a user