leonardoPimentelns / homeassistant-hacs-xbox

0 stars 0 forks source link

Initial load #2

Open iamdabe opened 9 months ago

iamdabe commented 9 months ago

Hi,

Was trying to get this up and running but hitting a issue as follows:

I've successfully generated the tokens.js

Would be great to get some debug info out (I've place the token.json in the root of the config folder for now)

Update for sensor.xbox fails `02:29:46 – (ERROR) helpers/entity.py - message first occurred at 02:29:27 and shows up 3 times

Logger: homeassistant.helpers.entity Source: helpers/entity.py:898 First occurred: 02:29:27 (3 occurrences) Last logged: 02:29:46

Update for sensor.xbox fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 898, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1216, in async_device_update await self.async_update() File "/config/custom_components/custom_xbox/sensor.py", line 78, in async_update self.results = await async_main(self.config ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/custom_xbox/sensor.py", line 148, in async_main get_xuid= await xbl_client.presence.get_presence_own() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/xbox/webapi/api/provider/presence/init.py", line 65, in get_presence_own resp = await self.client.session.get( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/xbox/webapi/api/client.py", line 86, in get return await self.request(hdrs.METH_GET, url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/xbox/webapi/api/client.py", line 60, in request await self._auth_mgr.refresh_tokens() File "/usr/local/lib/python3.11/site-packages/xbox/webapi/authentication/manager.py", line 71, in refresh_tokens self.oauth = await self.refresh_oauth_token() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/xbox/webapi/authentication/manager.py", line 98, in refresh_oauth_token return await self._oauth2_token_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/xbox/webapi/authentication/manager.py", line 115, in _oauth2_token_request resp.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1059, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://login.live.com/oauth20_token.srf') `

iamdabe commented 9 months ago

And tokens.json contains:

{"token_type": "bearer", "expires_in": 3600, "scope": "XboxLive.signin XboxLive.offline_access", "access_token": "EwAwA+pvBAAUKods63Ys1fGlwiccIFJ*******************", "refresh_token": "X.B602_AYE*******************", "user_id": "BBAA******", "issued": "2024-02-04T08:51:34.826760+00:00"}