Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
Arquivo: base.py Projeto: 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
Exemplo n.º 4
0
Arquivo: base.py Projeto: 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
Exemplo n.º 5
0
Arquivo: base.py Projeto: 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
Exemplo n.º 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