def call_brightness(*args, **kwargs):
 res = dict()
 if ('value' not in kwargs):
  raise CommandExecutionError("Parameter 'value' is missing")
 try:
  brightness = max(min(int(kwargs['value']), 244), 1)
 except Exception as err:
  raise CommandExecutionError("Parameter 'value' does not contains an integer")
 try:
  transition = max(min(int(kwargs['transition']), 200), 0)
 except Exception as err:
  transition = 0
 devices = _get_lights()
 for dev_id in ((('id' not in kwargs) and sorted(devices.keys())) or _get_devices(kwargs)):
  res[dev_id] = _set(dev_id, {'bri': brightness, 'transitiontime': transition})
 return res

def call_brightness ( * args , ** kwargs ) : res = dict ( ) if ( 'value' not in kwargs ) : raise CommandExecutionError ( "Parameter 'value' is missing" ) try : brightness = max ( min ( int ( kwargs [ 'value' ] ) , 244 ) , 1 ) except Exception as err : raise CommandExecutionError ( "Parameter 'value' does not contains an integer" ) try : transition = max ( min ( int ( kwargs [ 'transition' ] ) , 200 ) , 0 ) except Exception as err : transition = 0 devices = _get_lights ( ) for dev_id in ( ( ( 'id' not in kwargs ) and sorted ( devices . keys ( ) ) ) or _get_devices ( kwargs ) ) : res [ dev_id ] = _set ( dev_id , { 'bri' : brightness , 'transitiontime' : transition } ) return res
set an effect to the lamp .