mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fixed bug in history component where the entity id filtering was not being applied correctly
This commit is contained in:
parent
89527d3bb2
commit
100a75908b
@ -50,8 +50,10 @@ def state_changes_during_period(start_time, end_time=None, entity_id=None):
|
|||||||
|
|
||||||
result = defaultdict(list)
|
result = defaultdict(list)
|
||||||
|
|
||||||
|
entity_ids = [entity_id] if entity_id is not None else None
|
||||||
|
|
||||||
# Get the states at the start time
|
# Get the states at the start time
|
||||||
for state in get_states(start_time):
|
for state in get_states(start_time, entity_ids):
|
||||||
state.last_changed = start_time
|
state.last_changed = start_time
|
||||||
result[state.entity_id].append(state)
|
result[state.entity_id].append(state)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user