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

Unable to load data from the api #46

Open
rainepretorius opened this issue Feb 3, 2025 · 4 comments
Open

Unable to load data from the api #46

rainepretorius opened this issue Feb 3, 2025 · 4 comments

Comments

@rainepretorius
Copy link

Version of the custom_component

1.1.3

Configuration

Add your logs here.

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/eskom_loadshedding/sensor.py:185
integration: Eskom Loadshedding Interface (documentation, issues)
First occurred: 2 February 2025 at 23:26:39 (30 occurrences)
Last logged: 18:53:45

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 267, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 478, in _async_refresh
    self.async_update_listeners()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 177, in async_update_listeners
    update_callback()
    ~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 558, in _handle_coordinator_update
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1089, in __async_calculate_state
    if extra_state_attributes := self.extra_state_attributes:
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eskom_loadshedding/sensor.py", line 185, in extra_state_attributes
    "Area": info["name"],
            ~~~~^^^^^^^^
KeyError: 'name'

## Describe the bug
The whole integration as a whole seems to not be working as it seems that the api is not returning the data in the format that the integration needs.


## Debug log

<!-- To enable debug logs check this https://www.home-assistant.io/components/logger/ -->

```text

Add your logs here.
@wimdebruyn
Copy link

What version of HA are you running?

@rainepretorius
Copy link
Author

What version of HA are you running?

2025.1.4

@swartjean
Copy link
Owner

Seems to be working fine for me on 2025.1.4. Could have been a one-off issue on ESP's side, but I should probably check and log it more gracefully anyway.

Could you try and reinstall the integration?

@rainepretorius
Copy link
Author

rainepretorius commented Feb 3, 2025 via email

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

3 participants