From 2f9beb772aa60e6bfeda82940636629e7ae1bf65 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 16 Apr 2024 13:10:45 -0400 Subject: [PATCH] Correct type annotations in advertising/standard.py --- adafruit_ble/advertising/standard.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/adafruit_ble/advertising/standard.py b/adafruit_ble/advertising/standard.py index 3c9ef74..3bfc1a1 100644 --- a/adafruit_ble/advertising/standard.py +++ b/adafruit_ble/advertising/standard.py @@ -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 @@ -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 @@ -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):