예제 #1
0
파일: light.py 프로젝트: raudiez/tfg
 def findNewLights(self):
   """
   @summary: Search for new lights.
   """
   rest_obj = RestObject()
   path = 'api/{username}/lights'.format(username=self.user['name'])
   url = 'http://{bridge_ip}/{path}'.format(bridge_ip=self.bridge['ip'], path=path)
   response = rest_obj.post(url)
   return dict(resource=response)
예제 #2
0
 def findNewLights(self):
     """
 @summary: Search for new lights.
 """
     rest_obj = RestObject()
     path = 'api/{username}/lights'.format(username=self.user['name'])
     url = 'http://{bridge_ip}/{path}'.format(bridge_ip=self.bridge['ip'],
                                              path=path)
     response = rest_obj.post(url)
     return dict(resource=response)
예제 #3
0
파일: config.py 프로젝트: raudiez/tfg
 def createUser(self, user):
     """
 @summary: Create an user on the Hue Bridge.
 @param: user -> String with username to create.
 @return: Info about operation.
 """
     rest_obj = RestObject()
     url = 'http://{bridge_ip}/api'.format(bridge_ip=self.bridge['ip'])
     resource = {'devicetype': user, 'username': user}
     response = rest_obj.post(url, resource)
     return dict(resource=response)
예제 #4
0
파일: config.py 프로젝트: raudiez/tfg
 def createUser(self, user):
   """
   @summary: Create an user on the Hue Bridge.
   @param: user -> String with username to create.
   @return: Info about operation.
   """
   rest_obj = RestObject()
   url = 'http://{bridge_ip}/api'.format(bridge_ip=self.bridge['ip'])
   resource = {'devicetype': user, 'username': user}
   response = rest_obj.post(url, resource)
   return dict(resource=response)