From 8e881fdb183436c177c3400e687ad85342d48d93 Mon Sep 17 00:00:00 2001 From: Lucas Abel <22837557+uael@users.noreply.github.com> Date: Mon, 27 Mar 2023 14:23:15 -0700 Subject: [PATCH] smp: fix `PairingDelegate.get_number` return type This function can return `None` to indicate a negative reply, update the type hint accordingly. --- bumble/smp.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bumble/smp.py b/bumble/smp.py index 9a72cb0..cb2f6f6 100644 --- a/bumble/smp.py +++ b/bumble/smp.py @@ -522,7 +522,11 @@ class PairingDelegate: async def compare_numbers(self, number: int, digits: int) -> bool: return True - async def get_number(self) -> int: + async def get_number(self) -> Optional[int]: + ''' + Returns an optional number as an answer to a passkey request. + Returning `None` will result in a negative reply. + ''' return 0 # pylint: disable-next=unused-argument