@@ -219,20 +219,20 @@ def timeout(self):
219219 """
220220 Displays Timeout on screen when pyloton has been searching for a sensor for too long
221221 """
222- self ._status_update ("Timeout" )
222+ self ._status_update ("Pyloton: Timeout" )
223223 time .sleep (3 )
224224
225225
226226 def heart_connect (self ):
227227 """
228228 Connects to heart rate sensor
229229 """
230- self ._status_update ("Scanning..." )
230+ self ._status_update ("Heart Rate: Scanning..." )
231231 for adv in self .ble .start_scan (ProvideServicesAdvertisement , timeout = 5 ):
232232 if HeartRateService in adv .services :
233- self ._status_update ("Found a HeartRateService advertisement" )
233+ self ._status_update ("Heart Rate: Found an advertisement" )
234234 self .hr_connection = self .ble .connect (adv )
235- self ._status_update ("Connected" )
235+ self ._status_update ("Heart Rate: Connected" )
236236 break
237237 self .ble .stop_scan ()
238238 if self .hr_connection :
@@ -243,7 +243,7 @@ def ams_connect(self):
243243 """
244244 Connect to an Apple device using the ble_apple_media library
245245 """
246- self ._status_update ("Connect your phone now" )
246+ self ._status_update ("AppleMediaService: Connect your phone now" )
247247 radio = adafruit_ble .BLERadio ()
248248 a = SolicitServicesAdvertisement ()
249249 a .solicited_services .append (AppleMediaService )
@@ -252,14 +252,14 @@ def ams_connect(self):
252252 while not radio .connected :
253253 pass
254254
255- self ._status_update ("Connected" )
255+ self ._status_update ("AppleMediaService: Connected" )
256256
257257 #known_notifications = set()
258258
259259 for connection in radio .connections :
260260 if not connection .paired :
261261 connection .pair ()
262- self ._status_update ("paired " )
262+ self ._status_update ("AppleMediaService: Paired " )
263263
264264 self .ams = connection [AppleMediaService ]
265265
@@ -270,12 +270,12 @@ def speed_cad_connect(self):
270270 """
271271 Connects to speed and cadence sensor
272272 """
273- self ._status_update ("Scanning..." )
273+ self ._status_update ("Speed and Cadence: Scanning..." )
274274 # Save advertisements, indexed by address
275275 advs = {}
276276 for adv in self .ble .start_scan (ProvideServicesAdvertisement , timeout = 5 ):
277277 if CyclingSpeedAndCadenceService in adv .services :
278- self ._status_update ("found a CyclingSpeedAndCadenceService advertisement" )
278+ self ._status_update ("Speed and Cadence: Found an advertisement" )
279279 # Save advertisement. Overwrite duplicates from same address (device).
280280 advs [adv .address ] = adv
281281
@@ -289,14 +289,14 @@ def speed_cad_connect(self):
289289 self .cyc_connections = []
290290 for adv in advs .values ():
291291 self .cyc_connections .append (self .ble .connect (adv ))
292- self ._status_update ("Connected {}" .format (len (self .cyc_connections )))
292+ self ._status_update ("Speed and Cadence: Connected {}" .format (len (self .cyc_connections )))
293293
294294
295295 self .cyc_services = []
296296 for conn in self .cyc_connections :
297297
298298 self .cyc_services .append (conn [CyclingSpeedAndCadenceService ])
299- self ._status_update ("Finishing up..." )
299+ self ._status_update ("Pyloton: Finishing up..." )
300300 return self .cyc_connections
301301
302302
0 commit comments