File tree Expand file tree Collapse file tree 2 files changed +3
-30
lines changed
homeassistant/components/xbox Expand file tree Collapse file tree 2 files changed +3
-30
lines changed Original file line number Diff line number Diff line change 55from typing import NamedTuple
66
77from pythonxbox .api .client import XboxLiveClient
8- from pythonxbox .api .provider .catalog .const import HOME_APP_IDS , SYSTEM_PFN_ID_MAP
8+ from pythonxbox .api .provider .catalog .const import HOME_APP_IDS
99from pythonxbox .api .provider .catalog .models import (
1010 AlternateIdType ,
1111 CatalogResponse ,
@@ -42,7 +42,6 @@ class MediaTypeDetails(NamedTuple):
4242async def build_item_response (
4343 client : XboxLiveClient ,
4444 device_id : str ,
45- tv_configured : bool ,
4645 media_content_type : str ,
4746 media_content_id : str ,
4847) -> BrowseMedia | None :
@@ -83,29 +82,6 @@ async def build_item_response(
8382 )
8483 )
8584
86- # Add TV if configured
87- if tv_configured :
88- tv_catalog : CatalogResponse = (
89- await client .catalog .get_product_from_alternate_id (
90- SYSTEM_PFN_ID_MAP ["Microsoft.Xbox.LiveTV_8wekyb3d8bbwe" ][id_type ],
91- id_type ,
92- )
93- )
94- tv_thumb = _find_media_image (
95- tv_catalog .products [0 ].localized_properties [0 ].images
96- )
97- children .append (
98- BrowseMedia (
99- media_class = MediaClass .APP ,
100- media_content_id = "TV" ,
101- media_content_type = MediaType .APP ,
102- title = "Live TV" ,
103- can_play = True ,
104- can_expand = False ,
105- thumbnail = None if tv_thumb is None else tv_thumb .uri ,
106- )
107- )
108-
10985 content_types = sorted (
11086 {app .content_type for app in apps .result if app .content_type in TYPE_MAP }
11187 )
Original file line number Diff line number Diff line change @@ -176,7 +176,6 @@ async def async_browse_media(
176176 return await build_item_response (
177177 self .client ,
178178 self ._console .id ,
179- self .data .status .is_tv_configured ,
180179 media_content_type or "" ,
181180 media_content_id or "" ,
182181 ) # type: ignore[return-value]
@@ -187,10 +186,8 @@ async def async_play_media(
187186 """Launch an app on the Xbox."""
188187 if media_id == "Home" :
189188 await self .client .smartglass .go_home (self ._console .id )
190- elif media_id == "TV" :
191- await self .client .smartglass .show_tv_guide (self ._console .id )
192- else :
193- await self .client .smartglass .launch_app (self ._console .id , media_id )
189+
190+ await self .client .smartglass .launch_app (self ._console .id , media_id )
194191
195192
196193def _find_media_image (images : list [Image ]) -> Image | None :
You can’t perform that action at this time.
0 commit comments