albaintor / homeassistant_electrolux_status

Get the status from your Electrolux Care devices
MIT License
89 stars 22 forks source link

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

Open cloudbr34k84 opened 4 days ago

cloudbr34k84 commented 4 days ago

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:

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:

cloudbr34k84 commented 4 days ago

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 commented 4 days ago

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