Giter Site home page Giter Site logo

exception in async_update about ha-omada HOT 6 CLOSED

sogood007 avatar sogood007 commented on September 4, 2024
exception in async_update

from ha-omada.

Comments (6)

sogood007 avatar sogood007 commented on September 4, 2024
Exception in async_update when dispatching 'omada-update-89a8ded5f7d98c797c0690b57054fcf4': () Traceback (most recent call last): File "/config/custom_components/omada/omada_entity.py", line 111, in async_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 610, in _async_write_ha_state attr.update(self.extra_state_attributes or {}) File "/config/custom_components/omada/device_tracker.py", line 244, in extra_state_attributes return self.entity_description.extra_attributes_fn(self.controller, self._mac) File "/config/custom_components/omada/device_tracker.py", line 108, in client_attributes_fn if hasattr(client, k) and getattr(client, k): File "/config/custom_components/omada/api/clients.py", line 90, in radio return RADIO[self._raw.get("radioId")] TypeError: list indices must be integers or slices, not NoneType
Exception in async_update when dispatching 'omada-update-89a8ded5f7d98c797c0690b57054fcf4': () Traceback (most recent call last): File "/config/custom_components/omada/sensor.py", line 708, in async_update if self.update_value(): File "/config/custom_components/omada/sensor.py", line 691, in update_value next_value = self.entity_description.value_fn( File "/config/custom_components/omada/sensor.py", line 74, in client_rx_value_fn return round(controller.api.clients[mac].rx_rate / 1048576, 2) TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
Exception in async_update when dispatching 'omada-update-89a8ded5f7d98c797c0690b57054fcf4': () Traceback (most recent call last): File "/config/custom_components/omada/sensor.py", line 708, in async_update if self.update_value(): File "/config/custom_components/omada/sensor.py", line 691, in update_value next_value = self.entity_description.value_fn( File "/config/custom_components/omada/sensor.py", line 83, in client_tx_value_fn return round(controller.api.clients[mac].tx_rate / 1048576, 2) TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

I have the update version and it seems still have some issue. Looking more closely, it is complaining about the "div" op. So the clients may have tx_rate but it is NoneType .

from ha-omada.

zachcheatham avatar zachcheatham commented on September 4, 2024

Since the entity was added before logic was added to only create entities relevant to a device, I think this is still hanging around causing issues. New logic has been added to remove entities if they aren't supported by the associated device in the latest beta. Let me know if its still causing problems.

from ha-omada.

ltheoret avatar ltheoret commented on September 4, 2024

Hi,

I am getting tons of these errors since the 0.4.1 update. what is the cure or the cause.

`Logger: homeassistant.util.logging
Source: util/logging.py:156
First occurred: March 20, 2023 at 3:25:10 PM (154994 occurrences)
Last logged: 9:18:13 PM

Exception in async_update when dispatching 'omada-update-27cda8b4ee89c431c7acaa18f6b53b70': () Traceback (most recent call last): File "/config/custom_components/omada/omada_entity.py", line 111, in async_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 603, in _async_write_ha_state attr.update(self.extra_state_attributes or {}) File "/config/custom_components/omada/device_tracker.py", line 245, in extra_state_attributes return self.entity_description.extra_attributes_fn(self.controller, self._mac) File "/config/custom_components/omada/device_tracker.py", line 108, in client_attributes_fn if hasattr(client, k) and getattr(client, k): File "/config/custom_components/omada/api/clients.py", line 90, in radio return RADIO[self._raw.get("radioId")] TypeError: list indices must be integers or slices, not NoneType`
Luc

from ha-omada.

jone9618 avatar jone9618 commented on September 4, 2024

Hi,

I am getting tons of these errors since the 0.4.1 update. what is the cure or the cause.

`Logger: homeassistant.util.logging Source: util/logging.py:156 First occurred: March 20, 2023 at 3:25:10 PM (154994 occurrences) Last logged: 9:18:13 PM

Exception in async_update when dispatching 'omada-update-27cda8b4ee89c431c7acaa18f6b53b70': () Traceback (most recent call last): File "/config/custom_components/omada/omada_entity.py", line 111, in async_update self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 603, in _async_write_ha_state attr.update(self.extra_state_attributes or {}) File "/config/custom_components/omada/device_tracker.py", line 245, in extra_state_attributes return self.entity_description.extra_attributes_fn(self.controller, self._mac) File "/config/custom_components/omada/device_tracker.py", line 108, in client_attributes_fn if hasattr(client, k) and getattr(client, k): File "/config/custom_components/omada/api/clients.py", line 90, in radio return RADIO[self._raw.get("radioId")] TypeError: list indices must be integers or slices, not NoneType` Luc

Same here

from ha-omada.

zachcheatham avatar zachcheatham commented on September 4, 2024

In the exception posted, it shows line 90 representing return RADIO[self._raw.get("radioId")] from version 0.4.0. In 0.4.1, this was changed to return RADIO[self._raw.get("radioId", 0)]. Be sure that the latest version is installed and if you're still seeing the issue, try removing and reinstalling the integration via HACS.

from ha-omada.

jone9618 avatar jone9618 commented on September 4, 2024

Done. Looks like fixed. Thanks Zach. Had upgraded to 0.4.1 previously, but uninstall/reinstall seems to have done trick.
Thanks for great integration.

from ha-omada.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.