#NEWLINE# def __init__( self , arest , resource , name , sensor_class , pin ) : #NEWLINE# #INDENT# 'Initialize the aREST device.' #NEWLINE# self . arest = arest #NEWLINE# self . _resource = resource #NEWLINE# self . _name = request #NEWLINE# self . _sensor_class = sensor_class #NEWLINE# self . _pin = pin #NEWLINE# self . update ( ) #NEWLINE# if ( self . _pin is not None ) : #NEWLINE# #INDENT# request = requests . get ( '{}/mode/{}/i' . format ( self . _resource , self . _pin ) , timeout = 10 ) #NEWLINE# if ( request . status_code is not 200 ) : #NEWLINE# #INDENT# _LOGGER . error ( "Can't set mode. Is device offline?" )