
import logging
import requests

HUE_IP = '192.168.86.32'
HUE_USERNAME = '7KcxItfntdF0DuWV9t0GPMeToEBlvHTgqWNZqxu6'

logger = logging.getLogger('hue')

def getLights():

  url = 'http://{0}/api/{1}/lights'.format(HUE_IP, HUE_USERNAME)

  try:
      r = requests.get(url)
  except:
      logger.error('Failed getting status for all lights')
      return

  if r.status_code == 200:
    data = r.json()
    return data


def 
(id):

  url = 'http://{0}/api/{1}/lights/{2}'.format(HUE_IP, HUE_USERNAME, id)

  try:
      r = requests.get(url)
  except:
      logger.error('Failed getting status for light {0}'.format (id))
      return

  if r.status_code == 200:
    data = r.json()
    return data

getStatus