Skip to content

Commit

Permalink
Merge pull request #183 from brentyi/main
Browse files Browse the repository at this point in the history
Function signature fixes
  • Loading branch information
FoamyGuy committed Mar 13, 2023
2 parents f6a1436 + d1e34da commit 610b185
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions adafruit_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from .advertising import Advertisement

try:
from typing import Optional, Iterator, Union, Tuple, NoReturn, TYPE_CHECKING
from typing import Iterator, NoReturn, Optional, Tuple, Type, TYPE_CHECKING, Union
from typing_extensions import Literal

if TYPE_CHECKING:
Expand Down Expand Up @@ -72,7 +72,7 @@ def _discover_remote(self, uuid: UUID) -> Optional[_bleio.Service]:
self._discovered_bleio_services[uuid] = remote_service
return remote_service

def __contains__(self, key: Union[UUID, Service]) -> bool:
def __contains__(self, key: Union[UUID, Type[Service]]) -> bool:
"""
Allows easy testing for a particular Service class or a particular UUID
associated with this connection.
Expand All @@ -90,7 +90,7 @@ def __contains__(self, key: Union[UUID, Service]) -> bool:
uuid = key.uuid
return self._discover_remote(uuid) is not None

def __getitem__(self, key: Union[UUID, Service]) -> Optional[Service]:
def __getitem__(self, key: Union[UUID, Type[Service]]) -> Optional[Service]:
"""Return the Service for the given Service class or uuid, if any."""
uuid = key
maybe_service = False
Expand Down Expand Up @@ -221,7 +221,7 @@ def stop_advertising(self) -> None:

def start_scan(
self,
*advertisement_types: Advertisement,
*advertisement_types: Type[Advertisement],
buffer_size: int = 512,
extended: bool = False,
timeout: Optional[float] = None,
Expand Down

0 comments on commit 610b185

Please sign in to comment.