Do not guess app state in Xbox integration (#42067)

pull/42068/head
Jason Hunter 2020-10-18 23:30:44 -04:00 committed by GitHub
parent 5a397312e7
commit 33f0bf4c4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 9 deletions

View File

@ -7,7 +7,7 @@ from typing import Dict, Optional
import voluptuous as vol
from xbox.webapi.api.client import XboxLiveClient
from xbox.webapi.api.provider.catalog.const import HOME_APP_IDS, SYSTEM_PFN_ID_MAP
from xbox.webapi.api.provider.catalog.const import SYSTEM_PFN_ID_MAP
from xbox.webapi.api.provider.catalog.models import AlternateIdType, Product
from xbox.webapi.api.provider.people.models import (
PeopleResponse,
@ -220,14 +220,7 @@ class XboxUpdateCoordinator(DataUpdateCoordinator):
if catalog_result and catalog_result.products:
app_details = catalog_result.products[0]
else:
if not current_state or not current_state.status.focus_app_aumid:
id_type = AlternateIdType.LEGACY_XBOX_PRODUCT_ID
catalog_result = (
await self.client.catalog.get_product_from_alternate_id(
HOME_APP_IDS[id_type], id_type
)
)
app_details = catalog_result.products[0]
app_details = None
new_console_data[console.id] = ConsoleData(
status=status, app_details=app_details