home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.76k stars 30.86k forks source link

Xbox integration - error and no console discovered #42559

Closed snakuzzo closed 4 years ago

snakuzzo commented 4 years ago

The problem

Manual configuration is ok, but no console was discovered.

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

On HA start...

2020-10-29 09:40:13 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Configuration.yaml for xbox
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/config_entries.py", line 234, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/xbox/__init__.py", line 83, in async_setup_entry
    auth = api.AsyncConfigEntryAuth(
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/xbox/api.py", line 20, in __init__
    super().__init__(websession, "", "", "")
TypeError: __init__() takes 1 positional argument but 5 were given

Additional information

probot-home-assistant[bot] commented 4 years ago

Hey there @hunterjm, mind taking a look at this issue as its been labeled with an integration (xbox) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

tayanov commented 4 years ago

add azure app. but

Logger: homeassistant.helpers.integration_platform Source: components/xbox/media_source.py:46 First occurred: 12:14:24 (1 occurrences) Last logged: 12:14:24

Error processing platform xbox.media_source Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 41, in _process await process_platform(hass, component_name, platform) File "/usr/src/homeassistant/homeassistant/components/media_source/init.py", line 52, in _process_media_source_platform hass.data[DOMAIN][domain] = await platform.async_get_media_source(hass) File "/usr/src/homeassistant/homeassistant/components/xbox/media_source.py", line 46, in async_get_media_source entry = hass.config_entries.async_entries(DOMAIN)[0] IndexError: list index out of range

hunterjm commented 4 years ago

You still need to setup the integration through the UI after adding it to your configuration.

snakuzzo commented 4 years ago

@hunterjm is your answer for my problem? If yes...already done. Xbox integration is already enabled through UI...

image

...but the error persists every time I start HA

tayanov commented 4 years ago

image

hunterjm commented 4 years ago

These are two separate issues: @snakuzzo - You have the wrong version of xbox-web-api - did you previously use the custom component perhaps? pip3 install xbox-webapi==2.0.8 @tayanov - Your configuration is incorrect. It looks like the errors haven't been translated to your language yet, but you must either have cloud:, default_config: or xbox: in your configuration.yaml.

snakuzzo commented 4 years ago

@hunterjm I already have 2.0.8 version...

(homeassistant) homeassistant@snakeberry:~ $ pip3 list | grep xbox-webapi
xbox-webapi              2.0.8

I previously used xbox-webapi, but no custom components. I'd just created some scripts based on xbox-webapi to get authentication and turn on/off my console.

hunterjm commented 4 years ago

Weird, not sure what to tell you. The error is referencing this from the parent library: https://github.com/OpenXbox/xbox-webapi-python/blob/v2.0.8/xbox/webapi/authentication/manager.py#L24-L31

Maybe ensure that xbox-webapi is not installed anywhere else? like in your deps folder in Home Assistant?

snakuzzo commented 4 years ago

deps directory is empty

pi@snakeberry:/home/homeassistant/.homeassistant/deps $ ll
total 8
drwxrwxr--  2 homeassistant homeassistant 4096 Feb  1  2019 .
drwxrwxr-- 17 homeassistant homeassistant 4096 Oct 30 02:10 ..

Maybe I can try to remove previously data stored by xbox-webapi...

(homeassistant) homeassistant@snakeberry:~/.local/share/xbox $ ls -lart
total 20
drwxrwxr-- 3 homeassistant homeassistant 4096 Apr  2  2019 ..
drwxrwxr-- 2 homeassistant homeassistant 4096 Feb 23  2020 .
-rwxrwxr-- 1 homeassistant homeassistant  150 Oct 13 19:52 consoles.json
-rwxrwxr-- 1 homeassistant homeassistant 5858 Oct 30 02:04 tokens.json

EDIT: Nothing... :( ... same error. Removed stored files, but...

2020-10-30 02:15:10 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Configuration.yaml for xbox
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/config_entries.py", line 234, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/xbox/__init__.py", line 83, in async_setup_entry
    auth = api.AsyncConfigEntryAuth(
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/xbox/api.py", line 20, in __init__
    super().__init__(websession, "", "", "")
TypeError: __init__() takes 1 positional argument but 5 were given
snakuzzo commented 4 years ago

Solved...removed previously installed xbox-webapi 2.0.8 ...and now it worked