Add media class browse media attribute (#39770)
This commit is contained in:
parent
f075823529
commit
586d7eaba6
14 changed files with 248 additions and 18 deletions
|
@ -6,6 +6,7 @@ from typing import Tuple
|
|||
from aiohttp import web
|
||||
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.components.media_player.const import MEDIA_CLASS_DIRECTORY
|
||||
from homeassistant.components.media_player.errors import BrowseError
|
||||
from homeassistant.components.media_source.error import Unresolvable
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
@ -114,6 +115,7 @@ class LocalSource(MediaSource):
|
|||
media = BrowseMediaSource(
|
||||
domain=DOMAIN,
|
||||
identifier=f"{source_dir_id}/{path.relative_to(self.hass.config.path('media'))}",
|
||||
media_class=MEDIA_CLASS_DIRECTORY,
|
||||
media_content_type="directory",
|
||||
title=title,
|
||||
can_play=is_file,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue