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)
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)