def poll(self):
        if self.hub is None:
            return True

        api = self._get_api()
        if not api:
            return False
        lights = api['lights']

        manifest = self.config.get('manifest', {})

        for lamp_id, data in lights.items():
            address = id_2_addr(data['uniqueid'])
            name = data['name']
            lnode = self.get_node(address)
            if not lnode:
                lnode = HueColorLight(self, address, 
                                      name, lamp_id, 
                                      self.get_node('hub'), manifest)
            (color_x, color_y) = [round(val, 4)
                                  for val in data['state'].get('xy',[0.0,0.0])]
            brightness = round(data['state']['bri'] / 255. * 100., 4)
            brightness = brightness if data['state']['on'] else 0
            lnode.set_driver('GV1', color_x)
            lnode.set_driver('GV2', color_y)
            lnode.set_driver('ST', brightness)

        return True
Generates an access token and adds it to the database. If the refresh
dataset/ETHPy150Open UniversalDevicesInc/Polyglot/polyglot/node_servers/hue/hue.py/HueNodeServer.poll--crossover with--dataset/ETHPy150Open joaoqalves/web2py-oauth2/modules/oauth/storage/__init__.py/MongoStorage.add_access_token