ha-average icon indicating copy to clipboard operation
ha-average copied to clipboard

NameError: name 'ATTR_' is not defined

Open domo86 opened this issue 4 months ago • 0 comments

System Health details

Méthode d'installation Home Assistant OS Core 2025.9.1 Supervisor 2025.09.0 Operating System 16.2 Interface utilisateur 20250903.3

Checklist

  • [x] I have enabled debug logging for my installation.
  • [x] I have filled out the issue template to the best of my ability.
  • [x] This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • [x] This issue is not a duplicate issue of any previous issues..

Describe the issue

With the latest update of Homeassistant, I see in the log every 30 seconds this part: ( Version of average : 2.4.0 )

NameError: name 'ATTR_' is not defined 2025-09-10 20:04:40.976 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.puissance_moyenne fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 963, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1314, in async_device_update await self.async_update() File "/config/custom_components/average/sensor.py", line 310, in async_update await self._async_update_state() File "/config/custom_components/average/sensor.py", line 477, in _async_update_state self.init_mode(state) ~~~~~~~~~~~~~~~^^^^^^^ File "/config/custom_components/average/sensor.py", line 407, in init_mode ATTR ) ^^^^^ NameError: name 'ATTR' is not defined

Reproduction steps

Read logs

Debug logs

NameError: name 'ATTR_' is not defined
2025-09-10 20:04:40.976 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.puissance_moyenne fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 963, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1314, in async_device_update
    await self.async_update()
  File "/config/custom_components/average/sensor.py", line 310, in async_update
    await self._async_update_state()
  File "/config/custom_components/average/sensor.py", line 477, in _async_update_state
    self._init_mode(state)
    ~~~~~~~~~~~~~~~^^^^^^^
  File "/config/custom_components/average/sensor.py", line 407, in _init_mode
    ATTR_        )
    ^^^^^

Diagnostics dump

No response

domo86 avatar Sep 10 '25 18:09 domo86