Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error setting up Electrolux Status integration: Unexpected JSON response #109

Open
cloudbr34k84 opened this issue Nov 11, 2024 · 2 comments

Comments

@cloudbr34k84
Copy link

Description:
An error occurs while setting up the electrolux_status integration in Home Assistant. The integration attempts to retrieve a token from the Electrolux API but receives an unexpected response format. The API response is HTML instead of JSON, resulting in a ContentTypeError.

Logger: homeassistant.config_entries
Source: config_entries.py:635
First occurred: [Time of First Occurrence] (1 occurrences)
Last logged: [Last Log Time]

Error setting up entry [Your_Email_Here] for electrolux_status
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 635, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/electrolux_status/__init__.py", line 59, in async_setup_entry
    await coordinator.get_stored_token()
  File "/config/custom_components/electrolux_status/coordinator.py", line 174, in get_stored_token
    await self.api._get_gigya_client()  # noqa: SLF001
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/oneAppApi.py", line 390, in _get_gigya_client
    data = await self._get_identity_providers()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/oneAppApi.py", line 352, in _get_identity_providers
    token = await self._get_formatted_client_cred_token()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/oneAppApi.py", line 338, in _get_formatted_client_cred_token
    client_cred_token = await self.get_client_cred_token()
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/oneAppApi.py", line 55, in get_client_cred_token
    token = await self._api_client.login_client_credentials(base_url)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyelectroluxocp/oneAppApiClient.py", line 110, in login_client_credentials
    response_json = await response.json()
                    ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 80, in json
    return await super().json(*args, loads=loads, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1277, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 503, message='Attempt to decode JSON with unexpected mimetype: text/html', url='https://api.ocp.electrolux.one/one-account-authorization/api/v1/token'

Steps to Reproduce:

  • Set up the electrolux_status integration in Home Assistant.
  • Attempt to connect to the Electrolux API.
  • Observe the error log when Home Assistant tries to retrieve a token from the API.

Expected Behavior:
The integration should successfully retrieve a token from the Electrolux API, and the entry should be set up without errors.

Actual Behavior:
The integration encounters an error due to an unexpected response format from the Electrolux API, receiving HTML instead of JSON.

Additional Context:
The error may be due to:

  • API downtime or maintenance on Electrolux's end.
  • Potential rate limiting or IP restrictions by Electrolux.
  • Network issues that may lead to a non-JSON response.
@cloudbr34k84
Copy link
Author

I also notived that my app was just fritzing out , so i deleted the app, and now i cant log in. It wont let me get past the first screen where you choose your region. Anyone else experiencing this. Im in Australia

@robferre
Copy link

im in au too, looks like electolux is down as their own app is out of action
watching this to see when it comes back up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants