8b13658d3b39c1deadd5d6a88c102b8a856d80f3,homeassistant/components/media_player/blackbird.py,,setup_platform,#Any#Any#Any#Any#,63

Before Change


    from pyblackbird import get_blackbird
    from serial import SerialException

    if device_type == "serial":
        if port is None:
            _LOGGER.error("No port configured")
            return
        try:
            blackbird = get_blackbird(port)
        except SerialException:
            _LOGGER.error("Error connecting to the Blackbird controller")
            return

    elif device_type == "socket":
        try:
            if host is None:
                _LOGGER.error("No host configured")
                return
            blackbird = get_blackbird(host, False)
        except socket.timeout:
            _LOGGER.error("Error connecting to the Blackbird controller")
            return

    else:
        _LOGGER.error("Incorrect device type specified")
        return

    sources = {source_id: extra[CONF_NAME] for source_id, extra
               in config[CONF_SOURCES].items()}

    hass.data[DATA_BLACKBIRD] = []

After Change


def setup_platform(hass, config, add_devices, discovery_info=None):
    Set up the Monoprice Blackbird 4k 8x8 HDBaseT Matrix platform.
    if DATA_BLACKBIRD not in hass.data:
        hass.data[DATA_BLACKBIRD] = {}

    port = config.get(CONF_PORT)
    host = config.get(CONF_HOST)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: home-assistant/home-assistant
Commit Name: 8b13658d3b39c1deadd5d6a88c102b8a856d80f3
Time: 2018-05-02
Author: basti@linkt.de
File Name: homeassistant/components/media_player/blackbird.py
Class Name:
Method Name: setup_platform


Project Name: home-assistant/home-assistant
Commit Name: aa6a0523ef60f299d9c22333fdfe52687e902ee4
Time: 2016-08-20
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/camera/generic.py
Class Name: GenericCamera
Method Name: camera_image


Project Name: home-assistant/home-assistant
Commit Name: 68c1dd7cd47c516df765a1742a62abca5c3d5f83
Time: 2015-09-14
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/components/automation/__init__.py
Class Name:
Method Name: setup