src/foggycam.py
def initialize_user(self):
        """Gets the assets belonging to Nest user."""

        print ('INFO: Initializing current user...')

        user_url = self.nest_user_url.replace('#USERID#', self.nest_user_id)

        print ('INFO: Requesting user data from:')
        print (user_url)

        binary_data = json.dumps(self.nest_user_request_payload).encode('utf-8')

        request = urllib.request.Request(user_url, binary_data)

        request.add_header('Content-Type', 'application/json')
        request.add_header('Authorization', 'Basic %s' % self.nest_access_token)

        response = self.merlin.open(request)

        response_data = response.read()

        print (response_data)

        user_object = json.loads(response_data)
        for bucket in user_object['updated_buckets']:
            bucket_id = bucket['object_key']
            if bucket_id.startswith('quartz.'):
                camera_id = bucket_id.replace('quartz.', '')
                print ('INFO: Detected camera configuration.')
                print (bucket)
                print ('INFO: Camera UUID:')
                print (camera_id)
                self.nest_camera_array.append(camera_id)
Gets the assets belonging to Nest user.
Gets the assets belonging to Nest user.
Gets the assets belonging to Nest user .
def initialize_user(self):
        print ('INFO: Initializing current user...')
        user_url = self.nest_user_url.replace('#USERID#', self.nest_user_id)
        print ('INFO: Requesting user data from:')
        print (user_url)
        binary_data = json.dumps(self.nest_user_request_payload).encode('utf-8')
        request = urllib.request.Request(user_url, binary_data)
        request.add_header('Content-Type', 'application/json')
        request.add_header('Authorization', 'Basic %s' % self.nest_access_token)
        response = self.merlin.open(request)
        response_data = response.read()
        print (response_data)
        user_object = json.loads(response_data)
        for bucket in user_object['updated_buckets']:
            bucket_id = bucket['object_key']
            if bucket_id.startswith('quartz.'):
                camera_id = bucket_id.replace('quartz.', '')
                print ('INFO: Detected camera configuration.')
                print (bucket)
                print ('INFO: Camera UUID:')
                print (camera_id)
                self.nest_camera_array.append(camera_id)
def initialize_user ( self ) : print ( 'INFO: Initializing current user...' ) user_url = self . nest_user_url . replace ( '#USERID#' , self . nest_user_id ) print ( 'INFO: Requesting user data from:' ) print ( user_url ) binary_data = json . dumps ( self . nest_user_request_payload ) . encode ( 'utf-8' ) request = urllib . request . Request ( user_url , binary_data ) request . add_header ( 'Content-Type' , 'application/json' ) request . add_header ( 'Authorization' , 'Basic %s' % self . nest_access_token ) response = self . merlin . open ( request ) response_data = response . read ( ) print ( response_data ) user_object = json . loads ( response_data ) for bucket in user_object [ 'updated_buckets' ] : bucket_id = bucket [ 'object_key' ] if bucket_id . startswith ( 'quartz.' ) : camera_id = bucket_id . replace ( 'quartz.' , '' ) print ( 'INFO: Detected camera configuration.' ) print ( bucket ) print ( 'INFO: Camera UUID:' ) print ( camera_id ) self . nest_camera_array . append ( camera_id )
Gets the assets belonging to Nest user.
Gets the assets belonging to Nest user .
"""Gets the assets belonging to Nest user."""
self