Improve CastProtocol (#65357)

* Improve CastProtocol

* Tweak
This commit is contained in:
Erik Montnemery 2022-02-01 10:47:12 +01:00 committed by Paulus Schoutsen
parent 68651be2cc
commit 055382c84c
3 changed files with 5 additions and 3 deletions

View File

@ -67,7 +67,7 @@ class CastProtocol(Protocol):
"""Define the format of cast platforms."""
async def async_get_media_browser_root_object(
self, cast_type: str
self, hass: HomeAssistant, cast_type: str
) -> list[BrowseMedia]:
"""Create a list of root objects for media browsing."""

View File

@ -463,7 +463,7 @@ class CastDevice(MediaPlayerEntity):
for platform in self.hass.data[CAST_DOMAIN].values():
children.extend(
await platform.async_get_media_browser_root_object(
self._chromecast.cast_type
self.hass, self._chromecast.cast_type
)
)

View File

@ -14,7 +14,9 @@ from .const import PLEX_URI_SCHEME
from .services import lookup_plex_media
async def async_get_media_browser_root_object(cast_type: str) -> list[BrowseMedia]:
async def async_get_media_browser_root_object(
hass: HomeAssistant, cast_type: str
) -> list[BrowseMedia]:
"""Create a root object for media browsing."""
return [
BrowseMedia(