Example #1
0
 def post_command(self, cmd: Command, priority=2):
     cmd.device_id = self.device_id
     self._queue.put(cmd, priority)
     if not self._is_queue_check_running:
         t = Thread(target=self._queue_new_item)
         t.start()
Example #2
0
 def _post_command(self, cmd: Command, priority=0):
     cmd.device_id = self.device_id
     job = Job(task=self._execute_command, args=[cmd])
     self.scheduler.schedule_job(job)