625319846c77b37a9f2a5ffcf8d3be311cd534fe,homeassistant/components/homematic.py,,_get_devices,#Any#Any#,307
Before Change
params = _create_params_list(device, metadata, device_type)
if params:
// 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,
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[ATTR_PARAM] = param
// Add new device
try:
DEVICE_SCHEMA(device_dict)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
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: MycroftAI/padatious
Commit Name: a1383be585a1798a3333139c4c1be149d3c5a454
Time: 2017-09-15
Author: matthew3311999@gmail.com
File Name: padatious/util.py
Class Name:
Method Name: resolve_conflicts
Project Name: dpressel/mead-baseline
Commit Name: da1e8c2de9b265dcb18256a0a087165faf138b42
Time: 2019-01-14
Author: blester125@users.noreply.github.com
File Name: python/baseline/services.py
Class Name: EncoderDecoderService
Method Name: predict