Skip to content

Commit 79e59aa

Browse files
committed
handle new entry arg for __init__()
1 parent 1f58e21 commit 79e59aa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

adafruit_ble_adafruit/adafruit_service.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ class AdafruitServerAdvertisement(
6969
pid = ManufacturerDataField(_PID_DATA_ID, "<H")
7070
"""The USB PID (product id) for this board."""
7171

72-
def __init__(self):
73-
super().__init__()
72+
def __init__(self, *, entry=None):
73+
super().__init__(entry=entry)
74+
# Return early if things have been set by an existing ScanEntry.
75+
if entry:
76+
return
77+
# Creating an advertisement to send.
7478
self.connectable = True
7579
self.flags.general_discovery = True
7680
self.flags.le_only = True

0 commit comments

Comments
 (0)