Skip to content

Commit

Permalink
fix: compatibility testsuite with HA 2024.5
Browse files Browse the repository at this point in the history
  • Loading branch information
bramstroker committed May 3, 2024
1 parent 3a89849 commit a048830
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 193 deletions.
8 changes: 1 addition & 7 deletions custom_components/powercalc/sensors/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,13 +726,7 @@ def calculate_new_state(
entity_state.entity_id,
)
cur_state_value = self._get_state_value_in_native_unit(entity_state)

if prev_state:
prev_state_value = self._get_state_value_in_native_unit(prev_state)
else:
prev_state_value = (
cur_state_value if self._attr_native_value else Decimal(0)
)
prev_state_value = self._get_state_value_in_native_unit(prev_state) if prev_state else Decimal(0)
self._prev_state_store.set_entity_state(
self.entity_id,
entity_state.entity_id,
Expand Down
Loading

0 comments on commit a048830

Please sign in to comment.