def setup_bridge(bridge, add_devices_callback):
 lights = {}
 @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
 def update_lights():
  'Update the lights objects with latest info from bridge.'
  bridge.update_all_light_status()
  new_lights = []
  for (light_id, light) in bridge.lights().items():
   if (light_id not in lights):
    osram_light = OsramLightifyLight(light_id, light, update_lights)
    lights[light_id] = osram_light
    new_lights.append(osram_light)
   else:
    lights[light_id].light = light
  if new_lights:
   add_devices_callback(new_lights)
 update_lights()

def setup_bridge ( bridge , add_devices_callback ) : lights = { } @ util . Throttle ( MIN_TIME_BETWEEN_SCANS , MIN_TIME_BETWEEN_FORCED_SCANS ) def update_lights ( ) : bridge . update_all_light_status ( ) new_lights = [ ] for ( light_id , light ) in bridge . lights ( ) . items ( ) : if ( light_id not in lights ) : osram_light = OsramLightifyLight ( light_id , light , update_lights ) lights [ light_id ] = osram_light new_lights . append ( osram_light ) else : lights [ light_id ] . light = light if new_lights : add_devices_callback ( new_lights ) update_lights ( )
setup a wemo link .