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(light.setup(
            self.hass, {light.DOMAIN: {CONF_PLATFORM: 'test'}}
        ))

        dev1, dev2, dev3 = platform.DEVICES

        light.turn_on(self.hass, dev1.entity_id, profile='test')

        self.hass.pool.block_till_done()

        method, data = dev1.last_call('turn_on')

        self.assertEqual(
            {light.ATTR_XY_COLOR: (.4, .6), light.ATTR_BRIGHTNESS: 100},
            data)
Test light profiles.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/light/test_init.py/TestLight.test_light_profiles