From 100a75908bd1a93c9a9ac7b5bbab69cb7f449649 Mon Sep 17 00:00:00 2001 From: jamespcole Date: Tue, 7 Apr 2015 02:25:03 +1000 Subject: [PATCH] Fixed bug in history component where the entity id filtering was not being applied correctly --- homeassistant/components/history.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/history.py b/homeassistant/components/history.py index c547190b91a..ddce81b3476 100644 --- a/homeassistant/components/history.py +++ b/homeassistant/components/history.py @@ -50,8 +50,10 @@ def state_changes_during_period(start_time, end_time=None, entity_id=None): result = defaultdict(list) + entity_ids = [entity_id] if entity_id is not None else None + # 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 result[state.entity_id].append(state)