ORDER BY state_id DESC LIMIT 0, 5
return recorder.query_states(query, (entity_id, ))
def get_significant_states(start_time, end_time=None, entity_id=None):
After Change
Return the last 5 states for entity_id.
entity_id = entity_id.lower()
states = recorder.get_model("States")
return recorder.execute(
recorder.query("States").filter(
(states.entity_id == entity_id) &
(states.last_changed == states.last_updated)