Example #1
0
 def get_connector(self, connector_id):
     resp_dict = self._root.get('%s/connector/%d/' %
                                (API_VERSION, connector_id),
                                headers=self.headers)
     if resp_dict['connector']:
         return Connector.from_dict(resp_dict['connector'])
     return None
Example #2
0
 def get_connectors(self):
     resp_dict = self._root.get('%s/connectors' % API_VERSION,
                                headers=self.headers)
     connectors = [
         Connector.from_dict(connector_dict)
         for connector_dict in resp_dict['connectors']
     ]
     return connectors
Example #3
0
File: base.py Project: ymc/hue
 def get_connectors(self):
     resp_dict = self._root.get('%s/connector/all' % API_VERSION,
                                headers=self.headers)
     connectors = [
         Connector.from_dict(connector_dict,
                             resp_dict['resources-connector'])
         for connector_dict in resp_dict['all']
     ]
     return connectors
Example #4
0
File: base.py Project: Lt-Pone/hue
 def get_connector(self, connector_id):
   resp_dict = self._root.get('%s/connector/%d/' % (API_VERSION, connector_id), headers=self.headers)
   if resp_dict['connector']:
     return Connector.from_dict(resp_dict['connector'])
   return None
Example #5
0
File: base.py Project: Lt-Pone/hue
 def get_connectors(self):
   resp_dict = self._root.get('%s/connectors' % API_VERSION, headers=self.headers)
   connectors = [ Connector.from_dict(connector_dict) for connector_dict in resp_dict['connectors'] ]
   return connectors
Example #6
0
 def get_connectors(self):
   resp_dict = self._root.get('%s/connector/all' % API_VERSION, headers=self.headers)
   connectors = [ Connector.from_dict(connector_dict, resp_dict['resources-connector']) for connector_dict in resp_dict['all'] ]
   return connectors