diff --git a/homeassistant/components/recorder/history/legacy.py b/homeassistant/components/recorder/history/legacy.py index 6a66599e11b..ad9505e1af2 100644 --- a/homeassistant/components/recorder/history/legacy.py +++ b/homeassistant/components/recorder/history/legacy.py @@ -814,6 +814,7 @@ def _sorted_states_to_dict( } ) prev_state = state + continue for row in group: if (state := row[state_idx]) != prev_state: