human
Here's a good function header given the following:
I wrote the below code

    import serial
    port = config[DOMAIN][CONF_PORT]
    global BOARD
    try:
        BOARD = ArduinoBoard(port)
    except (serial.serialutil.SerialException, FileNotFoundError):
        _LOGGER.error('Your    port    %s    is    not    accessible', port)
        return False
    try:
        if (BOARD.get_firmata()[1] <= 2):
            _LOGGER.error('The    StandardFirmata    sketch    should    be    2.2    or    newer')
            return False
    except IndexError:
        _LOGGER.warning('The    version    of    the    StandardFirmata    sketch    was    notdetected.    This    may    lead    to    side    effects')
    def stop_arduino(event):
        'Stop    the    Arduino    service.'
        BOARD.disconnect()
    def start_arduino(event):
        'Start    the    Arduino    service.'
        hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_arduino)
    hass.bus.listen_once(EVENT_HOMEASSISTANT_START, start_arduino)
    return True

What's a good function header?
assistant
#Here's a good function header.

def setup(hass, config):