#NEWLINE# def turn_off( self , **kwargs ) : #NEWLINE# #INDENT# 'Turn the device off.' #NEWLINE# request = requests . get ( '{}/{}' . format ( self . _resource , self . _func ) , timeout = 10 , params = { #NEWLINE# #INDENT# 'params' : '0' , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( request . status_code == 200 ) : #NEWLINE# #INDENT# self . _state = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# _LOGGER . error ( "Can't turn off function %s at %s. Is device offline?" , self . _func , request . _resource )