PiotrMachowski / Home-Assistant-custom-components-iMPK

This sensor uses unofficial API retrieved by decompilation of iMPK application to provide a list of MPK Wrocław news available in original app.
MIT License
16 stars 1 forks source link

Task exception was never retrieved (None) #7

Open Krzysztonek opened 1 month ago

Krzysztonek commented 1 month ago

The following issue occurs:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1037, in _async_update_entity_states
    await entity.async_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1071, in __async_calculate_state
    if extra_state_attributes := self.extra_state_attributes:
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/impk/sensor.py", line 84, in extra_state_attributes
    attr['html_timetable'] = self.get_html_timetable()
                             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/impk/sensor.py", line 143, in get_html_timetable
    if len(direction) == 0:
       ^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
PiotrMachowski commented 1 month ago

When did it work for the last time?

Krzysztonek commented 1 month ago

When did it work for the last time?

I'm not able to reproduce this error, since the integration itself still works fine for me. All its features are reachable and they work without any visible issue. However, the above error is being displayed in the log file quite often with no visible reason.. Might be a minor bug?