'Test light profiles.'

def test_light_profiles(self):

    platform = loader.get_component('light.test')
    platform.init()
    user_light_file = self.hass.config.path(light.LIGHT_PROFILES_FILE)
    with open(user_light_file, 'w') as user_file:
        user_file.write('id,x,y,brightness\n')
        user_file.write('test,.4,.6,100\n')
    self.assertTrue(setup_component(self.hass, light.DOMAIN, {light.DOMAIN: {CONF_PLATFORM: 'test'}}))
    (dev1, _, _) = platform.DEVICES
    light.turn_on(self.hass, dev1.entity_id, profile='test')
    self.hass.block_till_done()
    (_, data) = dev1.last_call('turn_on')
    self.assertEqual({light.ATTR_XY_COLOR: (0.4, 0.6), light.ATTR_BRIGHTNESS: 100}, data)
