Verified Commit f154cffb authored by Jakob Moser's avatar Jakob Moser
Browse files

Add on_card_removed to card reader

parent 0b598ae4
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -27,6 +27,16 @@ class CardReader(AbstractContextManager, ABC):
        """
        ...

    @abstractmethod
    def on_card_removed(self, handle_removal: Callable[[CardReader], None]) -> None:
        """
        Register the function handle_removal so that it is called whenever a MIFARE Ultralight card was presented and removed again.

        If this is called multiple times, the CardReader may decide whether it only remembers and calls the
        last registered function, or all of them.
        """
        ...

    @abstractmethod
    def close(self) -> None:
        """