feat(button,media_player): Pair ADB carries entity_category CONFIG (t30 G11) + BrowseMediaSource domain parameter at root and children (t30 G18, 2026-05-20 blog contract); stubs/tests pin both
This commit is contained in:
1 parent
7c12d96070
commit
194a97ce34
4 files changed
+15
-1
No files matched your search
@@ -5,7 +5,7 @@ import logging
|
||||
from homeassistant.components.button import ButtonEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .adb_session import AdbMediaSessionPoller, ensure_adb_key
|
||||
@@ -36,6 +36,7 @@ class NvidiaShieldPairAdbButton(ButtonEntity):
|
||||
|
||||
_attr_has_entity_name = True
|
||||
_attr_name = "Pair ADB"
|
||||
_attr_entity_category = EntityCategory.CONFIG
|
||||
_attr_icon = "mdi:link-variant"
|
||||
|
||||
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||
|
||||
@@ -941,6 +941,8 @@ class NvidiaShieldMediaPlayer(MediaPlayerEntity):
|
||||
)
|
||||
|
||||
app_map = self._entry.options.get(CONF_APP_NAME_MAP) or DEFAULT_APP_DIRECTORY
|
||||
# G18 (2026-05-20 blog): BrowseMediaSource must carry the domain
|
||||
# parameter so the frontend can attribute the media tree.
|
||||
children = [
|
||||
BrowseMediaSource(
|
||||
title=name,
|
||||
@@ -949,6 +951,7 @@ class NvidiaShieldMediaPlayer(MediaPlayerEntity):
|
||||
media_content_id=pkg,
|
||||
can_play=True,
|
||||
can_expand=False,
|
||||
domain=DOMAIN,
|
||||
)
|
||||
for pkg, name in app_map.items()
|
||||
]
|
||||
@@ -960,6 +963,7 @@ class NvidiaShieldMediaPlayer(MediaPlayerEntity):
|
||||
can_play=False,
|
||||
can_expand=True,
|
||||
children=children,
|
||||
domain=DOMAIN,
|
||||
)
|
||||
|
||||
# ── play_media (§7): channel digits, app/url launch ──
|
||||
|
||||
Reference in new issue
Block a user