#NEWLINE# def test_light_profiles( self ) : #NEWLINE# #INDENT# 'Test light profiles.' #NEWLINE# platform = loader . get_component ( 'light.test' ) #NEWLINE# platform . init ( ) #NEWLINE# user_light_file = self . hass . config . path ( light . LIGHT_PROFILES_FILE ) #NEWLINE# with open ( user_light_file , 'w' ) as user_file : #NEWLINE# #INDENT# user_file . write ( 'id,x,y,brightness\n' ) #NEWLINE# user_file . write ( 'test,.4,.6,100\n' ) #NEWLINE# #UNINDENT# self . assertTrue ( light . setup ( self . hass , { #NEWLINE# #INDENT# light . DOMAIN : { #NEWLINE# #INDENT# CONF_PLATFORM : 'test' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# ( dev1 , dev2 , dev3 ) = platform . DEVICES #NEWLINE# light . turn_on ( dev1 . hass , dev1 . entity_id , profile = 'test' ) #NEWLINE# self . hass . pool . block_till_done ( ) #NEWLINE# ( method , data ) = dev1 . last_call ( 'turn_on' ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# light . ATTR_XY_COLOR : ( 0.4 , 0.6 ) , #NEWLINE# light . ATTR_BRIGHTNESS : 100 , #NEWLINE# #UNINDENT# } , data )