Skip to content

Commit

Permalink
Merge pull request #195 from adafruit/dhalbert-patch-1
Browse files Browse the repository at this point in the history
Correct type annotations in advertising/standard.py
  • Loading branch information
tannewt authored Apr 16, 2024
2 parents 28349ae + 2f9beb7 commit 9f2da7c
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 9f2da7c

Please sign in to comment.