8b13658d3b39c1deadd5d6a88c102b8a856d80f3,homeassistant/components/media_player/blackbird.py,,setup_platform,#Any#Any#Any#Any#,63
Before Change
Set up the Monoprice Blackbird 4k 8x8 HDBaseT Matrix platform.
port = config.get(CONF_PORT)
host = config.get(CONF_HOST)
device_type = config.get(CONF_TYPE)
import socket
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
// pylint: disable=unused-argument
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)
from pyblackbird import get_blackbird
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
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: abcfcdd8872dfe36c3a96afafdb4ba7f6abeb47d
Time: 2017-07-26
Author: cby@cby.me
File Name: homeassistant/components/weather/yweather.py
Class Name:
Method Name: setup_platform
Project Name: home-assistant/home-assistant
Commit Name: db23320659a711637b5164fbe6ae6db15cc48e48
Time: 2016-07-06
Author: dale3h@gmail.com
File Name: homeassistant/components/sensor/apcupsd.py
Class Name:
Method Name: setup_platform