mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Proper title, added album and artist for Squeezebox (#3735)
* Proper title, added album and artist Title had previously concatenated artist - title. * Made changes suggested by @balloobbot
This commit is contained in:
parent
aa8622f8e8
commit
39a446c43c
@ -126,7 +126,8 @@ class LogitechMediaServer(object):
|
||||
# a (artist): Artist name 'artist'
|
||||
# d (duration): Song duration in seconds 'duration'
|
||||
# K (artwork_url): URL to remote artwork
|
||||
tags = 'adK'
|
||||
# l (album): Album, including the server's "(N of M)"
|
||||
tags = 'adKl'
|
||||
new_status = {}
|
||||
try:
|
||||
telnet = telnetlib.Telnet(self.host, self.port)
|
||||
@ -236,14 +237,24 @@ class SqueezeBoxDevice(MediaPlayerDevice):
|
||||
@property
|
||||
def media_title(self):
|
||||
"""Title of current playing media."""
|
||||
if 'artist' in self._status and 'title' in self._status:
|
||||
return '{artist} - {title}'.format(
|
||||
artist=self._status['artist'],
|
||||
title=self._status['title']
|
||||
)
|
||||
if 'title' in self._status:
|
||||
return self._status['title']
|
||||
|
||||
if 'current_title' in self._status:
|
||||
return self._status['current_title']
|
||||
|
||||
@property
|
||||
def media_artist(self):
|
||||
"""Artist of current playing media."""
|
||||
if 'artist' in self._status:
|
||||
return self._status['artist']
|
||||
|
||||
@property
|
||||
def media_album_name(self):
|
||||
"""Album of current playing media."""
|
||||
if 'album' in self._status:
|
||||
return self._status['album'].rstrip()
|
||||
|
||||
@property
|
||||
def supported_media_commands(self):
|
||||
"""Flag of media commands that are supported."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user