def get_lights()

in s1e1-totally-lit/hue-python/danceparty.py [0:0]


def get_lights(LOCAL_HUE, USER_NAME):
    lights_info = {}
    light_url = 'http://'+ LOCAL_HUE + '/api/' + USER_NAME + '/lights'
    lights = requests.get(light_url)
    lights_data = lights.json()
    for l in lights_data:
        id = {}
        id['id'] = l
        light_name = lights_data[l]['name']
        lights_info[light_name] = id 
    return(lights_info)