Skip to content

Commit

Permalink
support multiple type checkers for pandora
Browse files Browse the repository at this point in the history
  • Loading branch information
barbibulle committed Jan 28, 2024
1 parent 5211d7b commit 986343a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bumble/pandora/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def confirm(self, auto: bool = False) -> bool:

event = self.add_origin(PairingEvent(just_works=empty_pb2.Empty()))
self.service.event_queue.put_nowait(event)
answer = await anext(self.service.event_answer) # pytype: disable=name-error
answer = await anext(self.service.event_answer) # type: ignore
assert answer.event == event
assert answer.answer_variant() == 'confirm' and answer.confirm is not None
return answer.confirm
Expand All @@ -125,7 +125,7 @@ async def compare_numbers(self, number: int, digits: int = 6) -> bool:

event = self.add_origin(PairingEvent(numeric_comparison=number))
self.service.event_queue.put_nowait(event)
answer = await anext(self.service.event_answer) # pytype: disable=name-error
answer = await anext(self.service.event_answer) # type: ignore
assert answer.event == event
assert answer.answer_variant() == 'confirm' and answer.confirm is not None
return answer.confirm
Expand All @@ -140,7 +140,7 @@ async def get_number(self) -> Optional[int]:

event = self.add_origin(PairingEvent(passkey_entry_request=empty_pb2.Empty()))
self.service.event_queue.put_nowait(event)
answer = await anext(self.service.event_answer) # pytype: disable=name-error
answer = await anext(self.service.event_answer) # type: ignore
assert answer.event == event
if answer.answer_variant() is None:
return None
Expand All @@ -157,7 +157,7 @@ async def get_string(self, max_length: int) -> Optional[str]:

event = self.add_origin(PairingEvent(pin_code_request=empty_pb2.Empty()))
self.service.event_queue.put_nowait(event)
answer = await anext(self.service.event_answer) # pytype: disable=name-error
answer = await anext(self.service.event_answer) # type: ignore
assert answer.event == event
if answer.answer_variant() is None:
return None
Expand Down

0 comments on commit 986343a

Please sign in to comment.