#NEWLINE# def update( self ) : #NEWLINE# #INDENT# 'Get the latest data from aREST API and update the state.' #NEWLINE# request = requests . get ( '{}/digital/{}' . format ( self . _resource , request . _pin ) , timeout = 10 ) #NEWLINE# self . _state = ( request . json ( ) [ 'return_value' ] != 0 )