Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/media_player/songpal.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def state(self):
@property
def source(self):
"""Return currently active source."""
return self._active_source.title
return getattr(self._active_source, 'title', None)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a single-line comment here describing the necessity of using getattr instead of regular attribute access here, then it's okay to merge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure - here you go. Is this comment sufficient?

@rytilahti rytilahti Jan 24, 2019

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good, thanks! I changed the title to be a bit more descriptive :-)


@property
def volume_level(self):
Expand Down