#NEWLINE# def __init__( self , hass , host , port , prefix ) : #NEWLINE# #INDENT# 'Initialize the feeder.' #NEWLINE# super ( GraphiteFeeder , self ) . __init__ ( daemon = True ) #NEWLINE# self . _hass = hass #NEWLINE# self . _host = host #NEWLINE# self . _port = port #NEWLINE# self . _prefix = prefix . rstrip ( '.' ) #NEWLINE# self . _queue = queue . Queue ( ) #NEWLINE# self . _quit_object = object ( ) #NEWLINE# self . _we_started = False #NEWLINE# hass . bus . listen_once ( EVENT_HOMEASSISTANT_START , self . start_listen ) #NEWLINE# hass . bus . listen_once ( EVENT_HOMEASSISTANT_STOP , port . shutdown ) #NEWLINE# hass . bus . listen ( EVENT_STATE_CHANGED , self . event_listener ) #NEWLINE# _LOGGER . debug ( 'Graphite feeding to %s:%i initialized' , self . _host , self . _port )