mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 23:57:06 +00:00
Fix album and artist returning "None" rather than None for Squeezebox media player. (#144971)
* fix * snapshot update * cast type
This commit is contained in:
parent
41be82f167
commit
9bb9132e7b
@ -6,7 +6,7 @@ from collections.abc import Callable
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any, cast
|
||||||
|
|
||||||
from pysqueezebox import Server, async_discover
|
from pysqueezebox import Server, async_discover
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -329,22 +329,22 @@ class SqueezeBoxMediaPlayerEntity(SqueezeboxEntity, MediaPlayerEntity):
|
|||||||
@property
|
@property
|
||||||
def media_title(self) -> str | None:
|
def media_title(self) -> str | None:
|
||||||
"""Title of current playing media."""
|
"""Title of current playing media."""
|
||||||
return str(self._player.title)
|
return cast(str | None, self._player.title)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_channel(self) -> str | None:
|
def media_channel(self) -> str | None:
|
||||||
"""Channel (e.g. webradio name) of current playing media."""
|
"""Channel (e.g. webradio name) of current playing media."""
|
||||||
return str(self._player.remote_title)
|
return cast(str | None, self._player.remote_title)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_artist(self) -> str | None:
|
def media_artist(self) -> str | None:
|
||||||
"""Artist of current playing media."""
|
"""Artist of current playing media."""
|
||||||
return str(self._player.artist)
|
return cast(str | None, self._player.artist)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_album_name(self) -> str | None:
|
def media_album_name(self) -> str | None:
|
||||||
"""Album of current playing media."""
|
"""Album of current playing media."""
|
||||||
return str(self._player.album)
|
return cast(str | None, self._player.album)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def repeat(self) -> RepeatMode:
|
def repeat(self) -> RepeatMode:
|
||||||
|
@ -78,12 +78,8 @@
|
|||||||
'group_members': list([
|
'group_members': list([
|
||||||
]),
|
]),
|
||||||
'is_volume_muted': True,
|
'is_volume_muted': True,
|
||||||
'media_album_name': 'None',
|
|
||||||
'media_artist': 'None',
|
|
||||||
'media_channel': 'None',
|
|
||||||
'media_duration': 1,
|
'media_duration': 1,
|
||||||
'media_position': 1,
|
'media_position': 1,
|
||||||
'media_title': 'None',
|
|
||||||
'query_result': dict({
|
'query_result': dict({
|
||||||
}),
|
}),
|
||||||
'repeat': <RepeatMode.OFF: 'off'>,
|
'repeat': <RepeatMode.OFF: 'off'>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user