diff --git a/homeassistant/components/kodi/media_player.py b/homeassistant/components/kodi/media_player.py index 99fae2af159..5067ee84826 100644 --- a/homeassistant/components/kodi/media_player.py +++ b/homeassistant/components/kodi/media_player.py @@ -913,8 +913,11 @@ class KodiEntity(MediaPlayerEntity): return response async def async_get_browse_image( - self, media_content_type, media_content_id, media_image_id=None - ): + self, + media_content_type: str, + media_content_id: str, + media_image_id: str | None = None, + ) -> tuple[bytes | None, str | None]: """Get media image from kodi server.""" try: image_url, _, _ = await get_media_info( diff --git a/homeassistant/components/philips_js/media_player.py b/homeassistant/components/philips_js/media_player.py index 53aa20f6606..964acef187c 100644 --- a/homeassistant/components/philips_js/media_player.py +++ b/homeassistant/components/philips_js/media_player.py @@ -457,8 +457,11 @@ class PhilipsTVMediaPlayer(CoordinatorEntity, MediaPlayerEntity): raise BrowseError(f"Media not found: {media_content_type} / {media_content_id}") async def async_get_browse_image( - self, media_content_type, media_content_id, media_image_id=None - ): + self, + media_content_type: str, + media_content_id: str, + media_image_id: str | None = None, + ) -> tuple[bytes | None, str | None]: """Serve album art. Returns (content, content_type).""" try: if media_content_type == MEDIA_TYPE_APP and media_content_id: diff --git a/homeassistant/components/plex/media_player.py b/homeassistant/components/plex/media_player.py index b59d86d5ecf..af1415e65bc 100644 --- a/homeassistant/components/plex/media_player.py +++ b/homeassistant/components/plex/media_player.py @@ -1,4 +1,6 @@ """Support to interface with the Plex API.""" +from __future__ import annotations + from functools import wraps import json import logging @@ -571,8 +573,11 @@ class PlexMediaPlayer(MediaPlayerEntity): ) async def async_get_browse_image( - self, media_content_type, media_content_id, media_image_id=None - ): + self, + media_content_type: str, + media_content_id: str, + media_image_id: str | None = None, + ) -> tuple[bytes | None, str | None]: """Get media image from Plex server.""" image_url = self.plex_server.thumbnail_cache.get(media_content_id) if image_url: diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index f4ce46dd5f5..b55c6cb4b13 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -606,10 +606,10 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity): async def async_get_browse_image( self, - media_content_type: str | None, - media_content_id: str | None, + media_content_type: str, + media_content_id: str, media_image_id: str | None = None, - ) -> tuple[None | str, None | str]: + ) -> tuple[bytes | None, str | None]: """Fetch media browser image to serve via proxy.""" if ( media_content_type in [MEDIA_TYPE_ALBUM, MEDIA_TYPE_ARTIST] diff --git a/homeassistant/components/squeezebox/media_player.py b/homeassistant/components/squeezebox/media_player.py index 5fa79aad9a7..5956b9fdf06 100644 --- a/homeassistant/components/squeezebox/media_player.py +++ b/homeassistant/components/squeezebox/media_player.py @@ -1,4 +1,6 @@ """Support for interfacing to the Logitech SqueezeBox API.""" +from __future__ import annotations + import asyncio import json import logging @@ -562,8 +564,11 @@ class SqueezeBoxEntity(MediaPlayerEntity): return await build_item_response(self, self._player, payload) async def async_get_browse_image( - self, media_content_type, media_content_id, media_image_id=None - ): + self, + media_content_type: str, + media_content_id: str, + media_image_id: str | None = None, + ) -> tuple[bytes | None, str | None]: """Get album art from Squeezebox server.""" if media_image_id: image_url = self._player.generate_image_url_from_track_id(media_image_id)