a2e45b8fdde315b756691b4ae573ad55f55dc002,homeassistant/components/history.py,,last_5_states,#Any#,26

Before Change


        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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 2

Instances


Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: homeassistant/components/history.py
Class Name:
Method Name: last_5_states


Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: tests/components/test_recorder.py
Class Name: TestRecorder
Method Name: _add_test_events


Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: homeassistant/components/logbook.py
Class Name: LogbookView
Method Name: get


Project Name: home-assistant/home-assistant
Commit Name: a2e45b8fdde315b756691b4ae573ad55f55dc002
Time: 2016-07-02
Author: rhooper@toybox.ca
File Name: tests/components/test_recorder.py
Class Name: TestRecorder
Method Name: _add_test_states