Skip to content

Commit bb3cdd3

Browse files
authored
Add media_content_id to media player in Xbox integration (home-assistant#156519)
1 parent 8d09b5c commit bb3cdd3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

homeassistant/components/xbox/media_player.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ def media_content_type(self) -> MediaType:
9999
return MediaType.GAME
100100
return MediaType.APP
101101

102+
@property
103+
def media_content_id(self) -> str | None:
104+
"""Content ID of current playing media."""
105+
return self.data.app_details.product_id if self.data.app_details else None
106+
102107
@property
103108
def media_title(self) -> str | None:
104109
"""Title of current playing media."""

tests/components/xbox/snapshots/test_media_player.ambr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
'entity_picture': 'http://store-images.s-microsoft.com/image/apps.9815.9007199266246365.7dc5d343-fe4a-40c3-93dd-c78e77f97331.45eebdef-f725-4799-bbf8-9ad8391a8279',
4242
'entity_picture_local': '/api/media_player_proxy/media_player.xone?token=mock_token&cache=739260d7bff66329',
4343
'friendly_name': 'XONE',
44+
'media_content_id': '9WZDNCRFJ3TJ',
4445
'media_content_type': <MediaType.APP: 'app'>,
4546
'media_title': 'Netflix',
4647
'supported_features': <MediaPlayerEntityFeature: 149385>,
@@ -95,6 +96,7 @@
9596
'entity_picture': 'http://store-images.s-microsoft.com/image/apps.9815.9007199266246365.7dc5d343-fe4a-40c3-93dd-c78e77f97331.45eebdef-f725-4799-bbf8-9ad8391a8279',
9697
'entity_picture_local': '/api/media_player_proxy/media_player.xonex?token=mock_token&cache=739260d7bff66329',
9798
'friendly_name': 'XONEX',
99+
'media_content_id': '9WZDNCRFJ3TJ',
98100
'media_content_type': <MediaType.APP: 'app'>,
99101
'media_title': 'Netflix',
100102
'supported_features': <MediaPlayerEntityFeature: 149385>,

0 commit comments

Comments
 (0)