#NEWLINE# def _mqtt_connect( self , client , userdata , flags , rc ) : #NEWLINE# #INDENT# logger . debug ( 'Client on_connect called.' ) #NEWLINE# if ( userdata == 0 ) : #NEWLINE# #INDENT# self . _connected = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( 'Error connecting to Adafruit IO with rc: {0}' . format ( rc ) ) #NEWLINE# #UNINDENT# if ( self . on_connect is not None ) : #NEWLINE# #INDENT# self . on_connect ( self )