def setup(hass, config):
    graphite_config = config.get('graphite', {})
    host = graphite_config.get('host', 'localhost')
    prefix = graphite_config.get('prefix', 'ha')
    try:
        port = int(graphite_config.get('port', 2003))
    except ValueError:
        _LOGGER.error('Invalid port specified')
        return False

    GraphiteFeeder(hass, host, port, prefix)
    return True
Setup the Graphite feeder.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/graphite.py/setup