#NEWLINE# def update( self ) : #NEWLINE# #INDENT# 'Get the latest data and updates the state.' #NEWLINE# self . data . update ( ) #NEWLINE# value = self . data . value #NEWLINE# if ( self . _value_template is not None ) : #NEWLINE# #INDENT# self . _state = template . render_with_possible_json_value ( self . _hass , self . _value_template , value , 'N/A' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _state = value