625319846c77b37a9f2a5ffcf8d3be311cd534fe,homeassistant/components/homematic.py,,_get_devices,#Any#Any#,307

Before Change


            // Generate options for 1...n elements with 1...n params
            for channel in range(1, device.ELEMENT + 1):
                _LOGGER.debug("Handling %s:%i", key, channel)
                if channel in params:
                    for param in params[channel]:
                        name = _create_ha_name(
                            name=device.NAME,
                            channel=channel,
                            param=param
                        )
                        device_dict = {
                            CONF_PLATFORM: "homematic",
                            ATTR_ADDRESS: key,
                            ATTR_NAME: name,
                            ATTR_CHANNEL: channel
                        }
                        if param is not None:
                            device_dict.update({ATTR_PARAM: param})

                        // Add new device
                        try:
                            DEVICE_SCHEMA(device_dict)
                            device_arr.append(device_dict)
                        except vol.MultipleInvalid as err:
                            _LOGGER.error("Invalid device config: %s",
                                          str(err))
                else:
                    _LOGGER.debug("Channel %i not in params", channel)
        else:
            _LOGGER.debug("Got no params for %s", key)
    _LOGGER.debug("%s autodiscovery: %s", device_type, str(device_arr))
    return device_arr

After Change


        if metadata:
            // Generate options for 1...n elements with 1...n params
            for param, channels in metadata.items():
                if param in HM_IGNORE_DISCOVERY_NODE:
                    continue

                // add devices
                _LOGGER.debug("Handling %s: %s", param, channels)
                for channel in channels:
                    name = _create_ha_name(
                        name=device.NAME,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: home-assistant/home-assistant
Commit Name: 625319846c77b37a9f2a5ffcf8d3be311cd534fe
Time: 2016-10-03
Author: pascal.vizeli@syshack.ch
File Name: homeassistant/components/homematic.py
Class Name:
Method Name: _get_devices


Project Name: home-assistant/home-assistant
Commit Name: edf500e66b9122837c2e46f4615a89aa058e10ec
Time: 2017-04-11
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/media_player/roku.py
Class Name:
Method Name: setup_platform


Project Name: Microsoft/nni
Commit Name: b7cd20e62f7dfb7b28407c84cd6b48098fddb915
Time: 2019-07-11
Author: Quanlu.Zhang@microsoft.com
File Name: src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
Class Name: BOHB
Method Name: handle_trial_end