mired = int(1000000. / temperature)


    #bridge.set_light(color_lights, 'ct', mired)
    #bridge.set_light(dimmable_lights, 'bri', int(brightness * 255))

    # Only change if transitioning or just changed to/from transitioning.
    if period != last_period or period == 'Transition':

        # Update dimshift scenes
        dayshift_scenes =   { scene.name : scene for scene in bridge.scenes if 'dayshift' in scene.name.lower()}

        for scene_object in dayshift_scenes.values():
            log.info('updating daylight scene: %s' % scene_object.name)
            bridge.set_scene_lights(scene_object,{'ct':mired,
                                                  'on':True,
                                                  'transitiontime':TRANSITION_TIME,
                                                  'bri':int(evening_brightness * 255)})


        # Update nightlight shift dimming scenes

        nightshift_scenes =   { scene.name : scene for scene in bridge.scenes if 'nightshift' in scene.name.lower()}

        for scene_object in nightshift_scenes.values():
            log.info('updating lightlight scenes: %s' % scene_object.name)
            bridge.set_scene_lights(scene_object,{'ct':mired,
                                                  'on':True,
                                                  'transitiontime':TRANSITION_TIME,
                                                  'bri':int(brightness * 255)})