コード例 #1
0
ファイル: blinkpy.py プロジェクト: tonyli508/blinkpy
 def setup_post_verify(self):
     """Initialize blink system after verification."""
     camera_list = self.get_cameras()
     networks = self.get_ids()
     for network_name, network_id in networks.items():
         if network_id not in camera_list.keys():
             camera_list[network_id] = {}
             _LOGGER.warning("No cameras found for %s", network_name)
         sync_module = BlinkSyncModule(self, network_name, network_id,
                                       camera_list[network_id])
         sync_module.start()
         self.sync[network_name] = sync_module
         self.cameras = self.merge_cameras()
     self.available = self.refresh()
     self.key_required = False
コード例 #2
0
ファイル: blinkpy.py プロジェクト: yangtianzhi/blinkpy
    def start(self):
        """
        Perform full system setup.

        Method logs in and sets auth token, urls, and ids for future requests.
        Essentially this is just a wrapper function for ease of use.
        """
        if self._username is None or self._password is None:
            self.login()
        else:
            self.get_auth_token()

        networks = self.get_ids()
        for network_name, network_id in networks.items():
            sync_module = BlinkSyncModule(self, network_name, network_id)
            sync_module.start()
            self.sync[network_name] = sync_module
        self.cameras = self.merge_cameras()
コード例 #3
0
    def start(self):
        """
        Perform full system setup.

        Method logs in and sets auth token, urls, and ids for future requests.
        Essentially this is just a wrapper function for ease of use.
        """
        if self._username is None or self._password is None:
            if not self.login():
                return
        elif not self.get_auth_token():
            return

        camera_list = self.get_cameras()
        networks = self.get_ids()
        for network_name, network_id in networks.items():
            if network_id not in camera_list.keys():
                camera_list[network_id] = {}
                _LOGGER.warning("No cameras found for %s", network_name)
            sync_module = BlinkSyncModule(self, network_name, network_id,
                                          camera_list[network_id])
            sync_module.start()
            self.sync[network_name] = sync_module
        self.cameras = self.merge_cameras()