Skip to content

Commit

Permalink
Fix source entity for new HA version
Browse files Browse the repository at this point in the history
  • Loading branch information
vortizhe committed Jun 18, 2023
1 parent 8469c7b commit c48ee9c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/ingeteam_modbus/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def __init__(
self._unit_time_str = unit_time
self._attr_icon = "mdi:chart-histogram"
self._attr_extra_state_attributes = {ATTR_SOURCE_ID: source_entity}
self._source_entity = source_entity
self._hub = hub

@property
Expand Down

1 comment on commit c48ee9c

@demonsis
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buenas tardes, la nueva version me da el siguiente error
Logger: homeassistant
Source: components/integration/sensor.py:403
First occurred: 20 de junio de 2023, 21:51:47 (74 occurrences)
Last logged: 16:06:52

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/restore_state.py", line 234, in _async_dump_states
await self.async_dump_states()
File "/usr/src/homeassistant/homeassistant/helpers/restore_state.py", line 223, in async_dump_states
for stored_state in self.async_get_stored_states()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/restore_state.py", line 190, in async_get_stored_states
stored_states = [
^
File "/usr/src/homeassistant/homeassistant/helpers/restore_state.py", line 192, in
state, self.entities[state.entity_id].extra_restore_state_data, now
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/integration/sensor.py", line 403, in extra_restore_state_data
self._last_valid_state,
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'CalculatedEnergySensor' object has no attribute '_last_valid_state'

No te se decir si las anteriores tambien me lo daba, ya que es ahora cuando he empezado a revisar los registros del home assistant,
Si puedes ayudarme te lo agradezco, un saludo

Please sign in to comment.