Handle statistics for sensor with changing state class (#55316)
This commit is contained in:
parent
cc857abfd2
commit
7e70252de5
4 changed files with 158 additions and 24 deletions
|
@ -352,7 +352,7 @@ def compile_statistics(
|
|||
# We have compiled history for this sensor before, use that as a starting point
|
||||
last_reset = old_last_reset = last_stats[entity_id][0]["last_reset"]
|
||||
new_state = old_state = last_stats[entity_id][0]["state"]
|
||||
_sum = last_stats[entity_id][0]["sum"]
|
||||
_sum = last_stats[entity_id][0]["sum"] or 0
|
||||
|
||||
for fstate, state in fstates:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue