Skip to content

Commit 2d919a6

Browse files
committed
handle new entry arg for __init__()
1 parent 1f58e21 commit 2d919a6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

adafruit_ble_adafruit/adafruit_service.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ 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__()
74-
self.connectable = True
75-
self.flags.general_discovery = True
76-
self.flags.le_only = True
72+
def __init__(self, *, entry=None):
73+
super().__init__(entry=entry)
74+
if entry is None:
75+
# This is not a received advertisement, but one that will be sent,
76+
# so do further initialization.
77+
self.connectable = True
78+
self.flags.general_discovery = True
79+
self.flags.le_only = True
7780

7881

7982
class AdafruitService(Service):

0 commit comments

Comments
 (0)