mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix media source for Xbox integration (#41959)
* fix media content type * fix comments
This commit is contained in:
parent
ca9ac48938
commit
d5bf27427c
@ -1,4 +1,4 @@
|
|||||||
"""Netatmo Media Source Implementation."""
|
"""Xbox Media Source Implementation."""
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
import logging
|
import logging
|
||||||
from typing import List, Tuple
|
from typing import List, Tuple
|
||||||
@ -78,7 +78,7 @@ class XboxSource(MediaSource):
|
|||||||
name: str = "Xbox Game Media"
|
name: str = "Xbox Game Media"
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistantType, client: XboxLiveClient):
|
def __init__(self, hass: HomeAssistantType, client: XboxLiveClient):
|
||||||
"""Initialize Netatmo source."""
|
"""Initialize Xbox source."""
|
||||||
super().__init__(DOMAIN)
|
super().__init__(DOMAIN)
|
||||||
|
|
||||||
self.hass: HomeAssistantType = hass
|
self.hass: HomeAssistantType = hass
|
||||||
@ -127,7 +127,7 @@ class XboxSource(MediaSource):
|
|||||||
domain=DOMAIN,
|
domain=DOMAIN,
|
||||||
identifier="",
|
identifier="",
|
||||||
media_class=MEDIA_CLASS_DIRECTORY,
|
media_class=MEDIA_CLASS_DIRECTORY,
|
||||||
media_content_type=None,
|
media_content_type="",
|
||||||
title="Xbox Game Media",
|
title="Xbox Game Media",
|
||||||
can_play=False,
|
can_play=False,
|
||||||
can_expand=True,
|
can_expand=True,
|
||||||
@ -200,7 +200,7 @@ class XboxSource(MediaSource):
|
|||||||
domain=DOMAIN,
|
domain=DOMAIN,
|
||||||
identifier=f"{title}~~{category}",
|
identifier=f"{title}~~{category}",
|
||||||
media_class=MEDIA_CLASS_DIRECTORY,
|
media_class=MEDIA_CLASS_DIRECTORY,
|
||||||
media_content_type=None,
|
media_content_type="",
|
||||||
title=f"{owner.title()} {kind.title()}",
|
title=f"{owner.title()} {kind.title()}",
|
||||||
can_play=False,
|
can_play=False,
|
||||||
can_expand=True,
|
can_expand=True,
|
||||||
@ -223,7 +223,7 @@ def _build_game_item(item: InstalledPackage, images: List[Image]):
|
|||||||
domain=DOMAIN,
|
domain=DOMAIN,
|
||||||
identifier=f"{item.title_id}#{item.name}#{thumbnail}",
|
identifier=f"{item.title_id}#{item.name}#{thumbnail}",
|
||||||
media_class=MEDIA_CLASS_GAME,
|
media_class=MEDIA_CLASS_GAME,
|
||||||
media_content_type=None,
|
media_content_type="",
|
||||||
title=item.name,
|
title=item.name,
|
||||||
can_play=False,
|
can_play=False,
|
||||||
can_expand=True,
|
can_expand=True,
|
||||||
@ -239,7 +239,7 @@ def _build_categories(title):
|
|||||||
domain=DOMAIN,
|
domain=DOMAIN,
|
||||||
identifier=f"{title}",
|
identifier=f"{title}",
|
||||||
media_class=MEDIA_CLASS_GAME,
|
media_class=MEDIA_CLASS_GAME,
|
||||||
media_content_type=None,
|
media_content_type="",
|
||||||
title=name,
|
title=name,
|
||||||
can_play=False,
|
can_play=False,
|
||||||
can_expand=True,
|
can_expand=True,
|
||||||
@ -257,7 +257,7 @@ def _build_categories(title):
|
|||||||
domain=DOMAIN,
|
domain=DOMAIN,
|
||||||
identifier=f"{title}~~{owner}#{kind}",
|
identifier=f"{title}~~{owner}#{kind}",
|
||||||
media_class=MEDIA_CLASS_DIRECTORY,
|
media_class=MEDIA_CLASS_DIRECTORY,
|
||||||
media_content_type=None,
|
media_content_type="",
|
||||||
title=f"{owner.title()} {kind.title()}",
|
title=f"{owner.title()} {kind.title()}",
|
||||||
can_play=False,
|
can_play=False,
|
||||||
can_expand=True,
|
can_expand=True,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user