|
8 | 8 | import logging |
9 | 9 |
|
10 | 10 | from httpx import HTTPStatusError, RequestError, TimeoutException |
11 | | -from xbox.webapi.api.client import XboxLiveClient |
12 | | -from xbox.webapi.api.provider.catalog.const import SYSTEM_PFN_ID_MAP |
13 | | -from xbox.webapi.api.provider.catalog.models import AlternateIdType, Product |
14 | | -from xbox.webapi.api.provider.people.models import Person |
15 | | -from xbox.webapi.api.provider.smartglass.models import ( |
| 11 | +from pythonxbox.api.client import XboxLiveClient |
| 12 | +from pythonxbox.api.provider.catalog.const import SYSTEM_PFN_ID_MAP |
| 13 | +from pythonxbox.api.provider.catalog.models import AlternateIdType, Product |
| 14 | +from pythonxbox.api.provider.people.models import Person |
| 15 | +from pythonxbox.api.provider.smartglass.models import ( |
16 | 16 | SmartglassConsoleList, |
17 | 17 | SmartglassConsoleStatus, |
18 | 18 | ) |
19 | | -from xbox.webapi.api.provider.titlehub.models import Title |
20 | | -from xbox.webapi.common.signed_session import SignedSession |
| 19 | +from pythonxbox.api.provider.titlehub.models import Title |
| 20 | +from pythonxbox.common.signed_session import SignedSession |
21 | 21 |
|
22 | 22 | from homeassistant.config_entries import ConfigEntry |
23 | 23 | from homeassistant.core import HomeAssistant |
24 | 24 | from homeassistant.exceptions import ConfigEntryNotReady |
25 | 25 | from homeassistant.helpers import config_entry_oauth2_flow, device_registry as dr |
26 | 26 | from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed |
| 27 | +from homeassistant.util.ssl import get_default_context |
27 | 28 |
|
28 | 29 | from . import api |
29 | 30 | from .const import DOMAIN |
@@ -90,7 +91,7 @@ async def _async_setup(self) -> None: |
90 | 91 | session = config_entry_oauth2_flow.OAuth2Session( |
91 | 92 | self.hass, self.config_entry, implementation |
92 | 93 | ) |
93 | | - signed_session = await self.hass.async_add_executor_job(SignedSession) |
| 94 | + signed_session = SignedSession(ssl_context=get_default_context()) |
94 | 95 | auth = api.AsyncConfigEntryAuth(signed_session, session) |
95 | 96 | self.client = XboxLiveClient(auth) |
96 | 97 |
|
@@ -183,7 +184,7 @@ async def _async_update_data(self) -> XboxData: |
183 | 184 |
|
184 | 185 | # Update user presence |
185 | 186 | try: |
186 | | - batch = await self.client.people.get_friends_own_batch([self.client.xuid]) |
| 187 | + batch = await self.client.people.get_friends_by_xuid(self.client.xuid) |
187 | 188 | friends = await self.client.people.get_friends_own() |
188 | 189 | except TimeoutException as e: |
189 | 190 | raise UpdateFailed( |
|
0 commit comments