From 8a52ffb9676d927b4b837936295817c66ba6da37 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 12 Jul 2024 09:10:21 -0500 Subject: [PATCH] Use a listcomp for more history results (#121830) --- .../components/recorder/history/modern.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/recorder/history/modern.py b/homeassistant/components/recorder/history/modern.py index b6acb6601ff..3cbec60e83f 100644 --- a/homeassistant/components/recorder/history/modern.py +++ b/homeassistant/components/recorder/history/modern.py @@ -738,16 +738,18 @@ def _sorted_states_to_dict( or split_entity_id(entity_id)[0] in NEED_ATTRIBUTE_DOMAINS ): ent_results.extend( - state_class( - db_state, - attr_cache, - start_time_ts, - entity_id, - db_state[state_idx], - db_state[last_updated_ts_idx], - False, - ) - for db_state in group + [ + state_class( + db_state, + attr_cache, + start_time_ts, + entity_id, + db_state[state_idx], + db_state[last_updated_ts_idx], + False, + ) + for db_state in group + ] ) continue