Esempio n. 1
0
 async def end_eject(self, eject_process: EjectTracker, ball_left):
     """End eject."""
     eject_process.cancel()
     self.debug_log("Exited eject mode. Eject success: %s", ball_left)
     if ball_left:
         self._set_ball_count(self._ball_count - 1)
     self._eject_started.clear()
     self._is_counting.release()
     self.ball_device.incoming_balls_handler.end_eject()
Esempio n. 2
0
    def start_eject(self, already_left=False) -> Generator[int, None, EjectTracker]:
        """Start eject."""
        yield from self.ball_device.incoming_balls_handler.start_eject()
        yield from self._is_counting.acquire()
        self._eject_started.set()
        self.debug_log("Entered eject mode.")

        eject_process = EjectTracker(self, already_left)
        if already_left:
            self._set_ball_count(self._ball_count + 1)
            yield from eject_process.will_eject()
        return eject_process
Esempio n. 3
0
    async def start_eject(self, already_left=False) -> EjectTracker:
        """Start eject."""
        await self.ball_device.incoming_balls_handler.start_eject()
        await self._is_counting.acquire()
        self._eject_started.set()
        self.debug_log("Entered eject mode.")

        eject_process = EjectTracker(self, already_left)
        if already_left:
            self._set_ball_count(self._ball_count + 1)
            await eject_process.will_eject()
        return eject_process