Skip to content

Commit 9bda79f

Browse files
committed
Commiting because I have no clue why this is broken
1 parent 6031eba commit 9bda79f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

CircuitPython_Pyloton/code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
speed_cad_connection = pyloton.speed_cad_connect()
4141
if not radio:
4242
print("Running ams_connection")
43-
radio = ams_connection
43+
radio = pyloton.ams_connect()
4444

4545
if time.time()-start >= 45:
4646
pyloton.timeout()

CircuitPython_Pyloton/pyloton.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,23 @@ def heart_connect(self):
153153
return self.hr_connection
154154

155155
def ams_connect(self):
156-
self.radio = adafruit_ble.BLERadio()
156+
self._status_update("Connect your phone now")
157+
radio = adafruit_ble.BLERadio()
157158
a = SolicitServicesAdvertisement()
158159
a.solicited_services.append(AppleMediaService)
159-
self.radio.start_adversising(a)
160+
radio.start_advertising(a)
160161

161-
while not self.radio.connected:
162+
while not radio.connected:
162163
pass
163164

164-
print("connected")
165+
self._status_update("Connected")
165166

166-
for connection in self.radio.connections:
167+
for connection in radio.connections:
167168
if not connection.paired:
168169
connection.pair()
169-
print("paired")
170+
self._status_update("paired")
170171
known_notifications = set()
171-
172+
self.radio = radio
172173
return self.radio
173174

174175

0 commit comments

Comments
 (0)