2828from .advertising import Advertisement
2929
3030try :
31- from typing import Optional , Iterator , Union , Tuple , NoReturn , TYPE_CHECKING
31+ from typing import Iterator , NoReturn , Optional , Tuple , Type , TYPE_CHECKING , Union
3232 from typing_extensions import Literal
3333
3434 if TYPE_CHECKING :
@@ -72,7 +72,7 @@ def _discover_remote(self, uuid: UUID) -> Optional[_bleio.Service]:
7272 self ._discovered_bleio_services [uuid ] = remote_service
7373 return remote_service
7474
75- def __contains__ (self , key : Union [UUID , Service ]) -> bool :
75+ def __contains__ (self , key : Union [UUID , Type [ Service ] ]) -> bool :
7676 """
7777 Allows easy testing for a particular Service class or a particular UUID
7878 associated with this connection.
@@ -90,7 +90,7 @@ def __contains__(self, key: Union[UUID, Service]) -> bool:
9090 uuid = key .uuid
9191 return self ._discover_remote (uuid ) is not None
9292
93- def __getitem__ (self , key : Union [UUID , Service ]) -> Optional [Service ]:
93+ def __getitem__ (self , key : Union [UUID , Type [ Service ] ]) -> Optional [Service ]:
9494 """Return the Service for the given Service class or uuid, if any."""
9595 uuid = key
9696 maybe_service = False
@@ -221,7 +221,7 @@ def stop_advertising(self) -> None:
221221
222222 def start_scan (
223223 self ,
224- * advertisement_types : Advertisement ,
224+ * advertisement_types : Type [ Advertisement ] ,
225225 buffer_size : int = 512 ,
226226 extended : bool = False ,
227227 timeout : Optional [float ] = None ,
0 commit comments