def setup(hass, config):
    device = config['scsgate']['device']
    global SCSGATE

    # pylint: disable=broad-except
    try:
        SCSGATE = SCSGate(device=device, logger=_LOGGER)
        SCSGATE.start()
    except Exception as exception:
        _LOGGER.error("Cannot setup SCSGate component: %s", exception)
        return False

    def stop_monitor(event):
        """Stop the SCSGate."""
        _LOGGER.info("Stopping SCSGate monitor thread")
        SCSGATE.stop()

    hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_monitor)

    return True
Identify a single customer by their unique id, and optionally add attributes
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/scsgate.py/setup--crossover with--dataset/ETHPy150Open customerio/customerio-python/customerio/__init__.py/CustomerIO.identify