#NEWLINE# def test_and_condition( self ) : #NEWLINE# #INDENT# "Test the 'and' condition." #NEWLINE# test = condition . from_config ( { #NEWLINE# #INDENT# 'condition' : 'and' , #NEWLINE# 'conditions' : [ { #NEWLINE# #INDENT# 'condition' : 'state' , #NEWLINE# 'entity_id' : 'sensor.temperature' , #NEWLINE# 'state' : '100' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'condition' : 'numeric_state' , #NEWLINE# 'entity_id' : 'sensor.temperature' , #NEWLINE# 'below' : 110 , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . hass . states . set ( 'sensor.temperature' , 120 ) #NEWLINE# assert ( not test ( test . hass ) ) #NEWLINE# self . hass . states . set ( 'sensor.temperature' , 105 ) #NEWLINE# assert ( not test ( self . hass ) ) #NEWLINE# self . hass . states . set ( 'sensor.temperature' , 100 ) #NEWLINE# assert test ( self . hass )