Skip to content

Correct type annotations in advertising/standard.py #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions adafruit_ble/advertising/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
try:
from typing import Optional, List, Tuple, Union, Type, Iterator, Iterable, Any
from adafruit_ble.uuid import UUID
from adafruit_ble.characteristics import Characteristic
from adafruit_ble.services import Service
from _bleio import ScanEntry

Expand Down Expand Up @@ -71,7 +70,7 @@ def __init__(
uuid = VendorUUID(data[16 * i : 16 * (i + 1)])
self._vendor_services.append(uuid)

def __contains__(self, key: Union[UUID, Characteristic]) -> bool:
def __contains__(self, key: Union[UUID, Service]) -> bool:
uuid = key
if hasattr(key, "uuid"):
uuid = key.uuid
Expand Down Expand Up @@ -353,7 +352,7 @@ class ServiceData(AdvertisingDataField):
"""Encapsulates service data. It is read as a memoryview which can be manipulated or set as a
bytearray to change the size."""

def __init__(self, service: Characteristic) -> None:
def __init__(self, service: Service) -> None:
if isinstance(service.uuid, StandardUUID):
self._adt = 0x16
elif isinstance(service.uuid, VendorUUID):
Expand Down
Loading