def set_lights_xy(hass, lights, x_val, y_val, brightness):
 for light in lights:
  if is_on(hass, light):
   turn_on(hass, light, xy_color=[x_val, y_val], brightness=brightness, transition=30)

def set_lights_xy ( hass , lights , x_val , y_val , brightness ) : for light in lights : if is_on ( hass , light ) : turn_on ( hass , light , xy_color = [ x_val , y_val ] , brightness = brightness , transition = 30 )
set color of array of lights .