diff --git a/adafruit_ble/__init__.py b/adafruit_ble/__init__.py index b6c4b8d..ec8b949 100755 --- a/adafruit_ble/__init__.py +++ b/adafruit_ble/__init__.py @@ -222,6 +222,10 @@ def start_scan(self, *advertisement_types, buffer_size=512, extended=False, time for possible_type in advertisement_types: if possible_type.matches(entry) and issubclass(possible_type, adv_type): adv_type = possible_type + # Double check the adv_type is requested. We may return Advertisement accidentally + # otherwise. + if adv_type not in advertisement_types: + continue advertisement = adv_type.from_entry(entry) if advertisement: yield advertisement diff --git a/adafruit_ble/advertising/adafruit.py b/adafruit_ble/advertising/adafruit.py index 570087a..cf96ba4 100755 --- a/adafruit_ble/advertising/adafruit.py +++ b/adafruit_ble/advertising/adafruit.py @@ -43,7 +43,6 @@ _MANUFACTURING_DATA_ADT = const(0xff) _ADAFRUIT_COMPANY_ID = const(0x0822) _COLOR_DATA_ID = const(0x0000) -_RADIO_DATA_ID = const(0x0001) # TODO: check this isn't already taken. class AdafruitColor(Advertisement): @@ -62,18 +61,3 @@ class AdafruitColor(Advertisement): key_encoding="