mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +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
2ba2248f67
commit
075a41c69a
@ -6,7 +6,7 @@ from collections.abc import Callable
|
||||
from datetime import datetime
|
||||
import json
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from typing import TYPE_CHECKING, Any, cast
|
||||
|
||||
from pysqueezebox import Server, async_discover
|
||||
import voluptuous as vol
|
||||
@ -330,22 +330,22 @@ class SqueezeBoxMediaPlayerEntity(SqueezeboxEntity, MediaPlayerEntity):
|
||||
@property
|
||||
def media_title(self) -> str | None:
|
||||
"""Title of current playing media."""
|
||||
return str(self._player.title)
|
||||
return cast(str | None, self._player.title)
|
||||
|
||||
@property
|
||||
def media_channel(self) -> str | None:
|
||||
"""Channel (e.g. webradio name) of current playing media."""
|
||||
return str(self._player.remote_title)
|
||||
return cast(str | None, self._player.remote_title)
|
||||
|
||||
@property
|
||||
def media_artist(self) -> str | None:
|
||||
"""Artist of current playing media."""
|
||||
return str(self._player.artist)
|
||||
return cast(str | None, self._player.artist)
|
||||
|
||||
@property
|
||||
def media_album_name(self) -> str | None:
|
||||
"""Album of current playing media."""
|
||||
return str(self._player.album)
|
||||
return cast(str | None, self._player.album)
|
||||
|
||||
@property
|
||||
def repeat(self) -> RepeatMode:
|
||||
|
@ -78,12 +78,8 @@
|
||||
'group_members': list([
|
||||
]),
|
||||
'is_volume_muted': True,
|
||||
'media_album_name': 'None',
|
||||
'media_artist': 'None',
|
||||
'media_channel': 'None',
|
||||
'media_duration': 1,
|
||||
'media_position': 1,
|
||||
'media_title': 'None',
|
||||
'query_result': dict({
|
||||
}),
|
||||
'repeat': <RepeatMode.OFF: 'off'>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user