cupra_we_connect icon indicating copy to clipboard operation
cupra_we_connect copied to clipboard

Error doing job: Task exception was never retrieved

Open daydy16 opened this issue 4 months ago • 9 comments

Cupra Integration is spaming the log with this error message:

2024-03-25 12:35:51.222 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 261, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 417, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 183, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 497, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1113, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1050, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 548, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/cupra_we_connect/sensor.py", line 268, in native_value
    state = get_object_value(self.entity_description.value(self.data.domains))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/cupra_we_connect/sensor.py", line 209, in <lambda>
    value=lambda data: data["measurements"][
                       ~~~~^^^^^^^^^^^^^^^^
KeyError: 'measurements'

I'm not 100% percent sure, but maybe this is also a root cause for my home assistant to crash frequently?

daydy16 avatar Mar 25 '24 11:03 daydy16