4c5e6399e9163c564992e20fec837cacb506533f,homeassistant/components/zoneminder.py,,get_state,#Any#,90

Before Change


    Get a state from the ZoneMinder API service.
    // Since the API uses sessions that expire, sometimes we need to re-auth
    // if the call fails.
    for _ in range(LOGIN_RETRIES):
        req = requests.get(urljoin(ZM["url"], api_url), cookies=ZM["cookies"],
                           timeout=DEFAULT_TIMEOUT)

        if req.status_code != requests.codes.ok:
            login()
        else:
            break
    else:
        _LOGGER.exception("Unable to get API response from ZoneMinder")

    return json.loads(req.text)


// pylint: disable=no-member
def change_state(api_url, post_data):

After Change


// pylint: disable=no-member
def get_state(api_url):
    Get a state from the ZoneMinder API service.
    return _zm_request("get", api_url)


// pylint: disable=no-member
def change_state(api_url, post_data):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 23

Instances


Project Name: home-assistant/home-assistant
Commit Name: 4c5e6399e9163c564992e20fec837cacb506533f
Time: 2017-02-09
Author: pschmitt@users.noreply.github.com
File Name: homeassistant/components/zoneminder.py
Class Name:
Method Name: get_state


Project Name: home-assistant/home-assistant
Commit Name: 4c5e6399e9163c564992e20fec837cacb506533f
Time: 2017-02-09
Author: pschmitt@users.noreply.github.com
File Name: homeassistant/components/zoneminder.py
Class Name:
Method Name: change_state


Project Name: home-assistant/home-assistant
Commit Name: 7bf7c727d1582fb82ac726a41fbd04d587a2fd5c
Time: 2017-02-10
Author: pschmitt@users.noreply.github.com
File Name: homeassistant/components/zoneminder.py
Class Name:
Method Name: change_state


Project Name: home-assistant/home-assistant
Commit Name: 7bf7c727d1582fb82ac726a41fbd04d587a2fd5c
Time: 2017-02-10
Author: pschmitt@users.noreply.github.com
File Name: homeassistant/components/zoneminder.py
Class Name:
Method Name: get_state


Project Name: home-assistant/home-assistant
Commit Name: 4c5e6399e9163c564992e20fec837cacb506533f
Time: 2017-02-09
Author: pschmitt@users.noreply.github.com
File Name: homeassistant/components/zoneminder.py
Class Name:
Method Name: get_state