def assign_light_group(lifx, group, singles): lights = [] if singles is not None: for light in singles: if type(light) is list: lights.append(Light(light[0], light[1])) else: lights.append( lifx.get_devices_by_name(light).get_device_list()) if group is not None: lights = lights + lifx.get_devices_by_group(group).get_device_list() return Group(lights)