uvjim / linksys_velop

Home Assistant integration for the Linksys Velop
MIT License
50 stars 7 forks source link

Sensor platform - Task exception was never retrieved errors #448

Closed pantherale0 closed 9 months ago

pantherale0 commented 9 months ago

Hi,

HA: 2024.1.6

Been using this for a while however noticed today while looking in my logs the following error spamming the logs:


This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/linksys_velop/sensor.py:742
Integration: Linksys Velop (documentation, issues)
First occurred: 11 February 2024 at 17:50:57 (1514 occurrences)
Last logged: 19:56:02

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 243, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 399, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_update_listeners
    update_callback()
  File "/config/custom_components/linksys_velop/__init__.py", line 972, in _handle_coordinator_update
    super()._handle_coordinator_update()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 479, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 945, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1066, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1003, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 951, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 524, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/linksys_velop/sensor.py", line 957, in native_value
    return self._additional_description.state_value(self._node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/linksys_velop/sensor.py", line 742, in <lambda>
    ).lower()
      ^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'

As you can see 1.5k+ instances of this error over the space of just over 24 hours.

Integration seems to be working though (I only use it for device_tracker as the APs are in bridge mode).

uvjim commented 9 months ago

I know what's causing that... I'll get it fixed and let you know when it's done.

uvjim commented 9 months ago

Well, hopefully that was quicker than I thought it might be.

I've just pushed beta version 2024.2.1b0. Would you be able to test that please? I don't see the error here so difficult for me to test it.

pantherale0 commented 9 months ago

Will give it a try shortly :+1:

pantherale0 commented 9 months ago

All seems to be fine now 👍