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

Powerwall Issue: TypeError: type NoneType doesn't define __round__ method - return round(self._energysite.energy_left) #930

Closed
1 task done
purcell-lab opened this issue Mar 28, 2024 · 2 comments
Labels
triage New issues raised that need initial attention

Comments

@purcell-lab
Copy link
Contributor

Is there an existing issue for this?

  • I have searched both the existing open issues & recently closed issues and did not find a duplicate of this issue.

Version of the Tesla component

c3.20.4

Version of the Powerwall Gateway software

24.4.0 0fe780c9

Model

2

Current Behavior

With the recent upstream API breakage the Powerwall component of the integration isn't happy and refuses to load entity values:

image

Expected Behavior

The integration should report against the entities that it can receive and fail gracefully for others that it cannot identify.

Debug logs

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/tesla_custom/sensor.py:443
integration: Tesla Custom Integration (documentation, issues)
First occurred: March 28, 2024 at 8:26:42 PM (3818 occurrences)
Last logged: 9:05:03 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 258, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 414, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 998, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1119, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1056, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1004, 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/tesla_custom/sensor.py", line 443, in native_value
    return round(self._energysite.energy_left)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: type NoneType doesn't define __round__ method


### Anything else?

_No response_
@purcell-lab purcell-lab added the triage New issues raised that need initial attention label Mar 28, 2024
@skipishere
Copy link
Collaborator

Duplicate of #919

@skipishere skipishere marked this as a duplicate of #919 Mar 28, 2024
@alandtse
Copy link
Owner

@skipishere feel free to close dupes once identified. It makes it easier to try to reduce the issues people have to search through. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage New issues raised that need initial attention
Projects
None yet
Development

No branches or pull requests

3 participants