28
28
from .advertising import Advertisement
29
29
30
30
try :
31
- from typing import Optional , Iterator , Union , Tuple , NoReturn , TYPE_CHECKING
31
+ from typing import Iterator , NoReturn , Optional , Tuple , Type , TYPE_CHECKING , Union
32
32
from typing_extensions import Literal
33
33
34
34
if TYPE_CHECKING :
@@ -72,7 +72,7 @@ def _discover_remote(self, uuid: UUID) -> Optional[_bleio.Service]:
72
72
self ._discovered_bleio_services [uuid ] = remote_service
73
73
return remote_service
74
74
75
- def __contains__ (self , key : Union [UUID , Service ]) -> bool :
75
+ def __contains__ (self , key : Union [UUID , Type [ Service ] ]) -> bool :
76
76
"""
77
77
Allows easy testing for a particular Service class or a particular UUID
78
78
associated with this connection.
@@ -90,7 +90,7 @@ def __contains__(self, key: Union[UUID, Service]) -> bool:
90
90
uuid = key .uuid
91
91
return self ._discover_remote (uuid ) is not None
92
92
93
- def __getitem__ (self , key : Union [UUID , Service ]) -> Optional [Service ]:
93
+ def __getitem__ (self , key : Union [UUID , Type [ Service ] ]) -> Optional [Service ]:
94
94
"""Return the Service for the given Service class or uuid, if any."""
95
95
uuid = key
96
96
maybe_service = False
@@ -221,7 +221,7 @@ def stop_advertising(self) -> None:
221
221
222
222
def start_scan (
223
223
self ,
224
- * advertisement_types : Advertisement ,
224
+ * advertisement_types : Type [ Advertisement ] ,
225
225
buffer_size : int = 512 ,
226
226
extended : bool = False ,
227
227
timeout : Optional [float ] = None ,
0 commit comments