File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 54
54
pyloton .setup_display ()
55
55
56
56
while ((not HEART or hr_connection .connected ) and
57
- ((not SPEED or not CADENCE ) or speed_cadence_connections [0 ].connected ) and
57
+ ((not SPEED or not CADENCE ) or
58
+ (speed_cadence_connections and speed_cadence_connections [0 ].connected )) and
58
59
(not AMS or ams .connected )):
59
60
pyloton .update_display ()
60
61
pyloton .ams_remote ()
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ def _status_update(self, message):
206
206
207
207
if len (message ) > 25 :
208
208
self .status .text = message [:25 ]
209
- self .status1 .text = message [25 :]
209
+ self .status1 .text = message [25 :50 ]
210
210
211
211
else :
212
212
self .status .text = message
@@ -382,6 +382,12 @@ def read_s_and_c(self):
382
382
383
383
cadence = self ._compute_cadence (values , cadence )
384
384
385
+ if speed :
386
+ if len (str (speed )) > 8 :
387
+ speed = str (speed )[:8 ]
388
+ if cadence :
389
+ if len (str (cadence )) > 8 :
390
+ cadence = str (cadence )[:8 ]
385
391
return speed , cadence
386
392
387
393
@@ -395,6 +401,9 @@ def read_heart(self):
395
401
else :
396
402
heart = measurement .heart_rate
397
403
self ._previous_heart = measurement .heart_rate
404
+ if heart :
405
+ if len (str (heart )) > 4 :
406
+ heart = str (heart )[:4 ]
398
407
return heart
399
408
400
409
@@ -412,9 +421,12 @@ def read_ams(self):
412
421
data = self .ams .artist
413
422
if not self .track_artist :
414
423
data = self .ams .title
415
- except RuntimeError :
424
+ except ( RuntimeError , UnicodeError ) :
416
425
data = None
417
426
427
+ if data :
428
+ if len (data ) > 20 :
429
+ data = data [:20 ]
418
430
return data
419
431
420
432
You can’t perform that action at this time.
0 commit comments