mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix implicit-return in yamaha (#122942)
This commit is contained in:
parent
2f3f124aa1
commit
d393317eb2
@ -427,19 +427,21 @@ class YamahaDeviceZone(MediaPlayerEntity):
|
|||||||
self.zctrl.surround_program = sound_mode
|
self.zctrl.surround_program = sound_mode
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_artist(self):
|
def media_artist(self) -> str | None:
|
||||||
"""Artist of current playing media."""
|
"""Artist of current playing media."""
|
||||||
if self._play_status is not None:
|
if self._play_status is not None:
|
||||||
return self._play_status.artist
|
return self._play_status.artist
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_album_name(self):
|
def media_album_name(self) -> str | None:
|
||||||
"""Album of current playing media."""
|
"""Album of current playing media."""
|
||||||
if self._play_status is not None:
|
if self._play_status is not None:
|
||||||
return self._play_status.album
|
return self._play_status.album
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_content_type(self):
|
def media_content_type(self) -> MediaType | None:
|
||||||
"""Content type of current playing media."""
|
"""Content type of current playing media."""
|
||||||
# Loose assumption that if playback is supported, we are playing music
|
# Loose assumption that if playback is supported, we are playing music
|
||||||
if self._is_playback_supported:
|
if self._is_playback_supported:
|
||||||
@ -447,7 +449,7 @@ class YamahaDeviceZone(MediaPlayerEntity):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_title(self):
|
def media_title(self) -> str | None:
|
||||||
"""Artist of current playing media."""
|
"""Artist of current playing media."""
|
||||||
if self._play_status is not None:
|
if self._play_status is not None:
|
||||||
song = self._play_status.song
|
song = self._play_status.song
|
||||||
@ -459,3 +461,4 @@ class YamahaDeviceZone(MediaPlayerEntity):
|
|||||||
return f"{station}: {song}"
|
return f"{station}: {song}"
|
||||||
|
|
||||||
return song or station
|
return song or station
|
||||||
|
return None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user