def setup_platform(hass, config, add_devices, discovery_info=None):
    import snapcast.control
    host = config.get('host')
    port = config.get('port', snapcast.control.CONTROL_PORT)
    if not host:
        _LOGGER.error('No snapserver host specified')
        return
    try:
        server = snapcast.control.Snapserver(host, port)
    except socket.gaierror:
        _LOGGER.error('Could not connect to Snapcast server at %s:%d',
                      host, port)
        return
    add_devices([SnapcastDevice(client) for client in server.clients])
Setup the Snapcast platform.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/media_player/snapcast.py/setup_platform