Fixed logic to allow pyloton to work with discrete speed and cadence sensors
@@ -247,8 +247,9 @@ class Pyloton:
self._previous_crank_rev = values.cumulative_crank_revolutions
self._previous_crank = values.last_crank_event_time
+ else:
+ speed=cadence=0
return speed, cadence
- return 0, 0
def read_heart(self, hr_service):
@@ -344,6 +345,7 @@ class Pyloton:
"""
if self.heart_enabled:
heart = self.read_heart(hr_service)
+ if self.speed_enabled or self.cadence_enabled:
speed, cadence = self.read_s_and_c()
if self.heart_enabled:
