b6d335f9939e0cf1a8a57b581410866dce7fd2dd,homeassistant/components/sensor/netdata.py,,setup_platform,#Any#Any#Any#Any#,58

Before Change


    data_url = "{}/{}/data?chart=".format(url, _RESOURCE)
    resources = config.get(CONF_RESOURCES)

    try:
        response = requests.get(version_url, timeout=10)
        if not response.ok:
            _LOGGER.error("Response status is "%s"", response.status_code)
            return False
    except requests.exceptions.ConnectionError:
        _LOGGER.error("No route to resource/endpoint: %s", url)
        return False

    values = {}
    for key, value in sorted(SENSOR_TYPES.items()):
        if key in resources:
            values.setdefault(value[2], []).append(key)

After Change


    for chart in values:
        rest_url = "{}{}&{}".format(data_url, chart, _REALTIME)
        rest = NetdataData(rest_url)
        rest.update()
        for sensor_type in values[chart]:
            dev.append(NetdataSensor(rest, name, sensor_type))

    add_devices(dev, True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: home-assistant/home-assistant
Commit Name: b6d335f9939e0cf1a8a57b581410866dce7fd2dd
Time: 2017-06-21
Author: mail@fabian-affolter.ch
File Name: homeassistant/components/sensor/netdata.py
Class Name:
Method Name: setup_platform


Project Name: home-assistant/home-assistant
Commit Name: 4a421e25b08f453feba08ad78c4865c2abcc4790
Time: 2016-01-02
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/binary_sensor/rest.py
Class Name:
Method Name: setup_platform


Project Name: home-assistant/home-assistant
Commit Name: 4a421e25b08f453feba08ad78c4865c2abcc4790
Time: 2016-01-02
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/sensor/rest.py
Class Name:
Method Name: setup_platform