TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jul 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✓ |
Maintained by Joel Stewart.
This Swifty Sensor extension adds a Wahoo Trainer Characteristic to the Cycling Power Service for controlling Wahoo Trainers (KICKR and KICKR SNAP).
Coming Soon
Coming Soon
When setting up your SensorManager, simply activate the Wahoo Trainer Characteristic.
import SwiftySensors
import SwiftySensorsWahoo
// Customize what services you want to scan for
SensorManager.instance.setServicesToScanFor([
CyclingPowerService.self
])
CyclingPowerService.WahooTrainer.activate()
If a CyclingPowerService has a Wahoo Trainer Characteristic, you can get (check for) a reference to it:
guard let wahooTrainer: CyclingPowerService.WahooTrainer = cyclingPowerService.characteristic() { else return }
The Wahoo Trainer Characteristic provides methods to control the Trainer:
let targetWatts: UInt16 = 150
wahooTrainer.setResistanceErg(targetWatts)
let trainerLevel: UInt8 = 3
wahooTrainer.setResistanceLevel(trainerLevel)
There is an occassional crash when disconnecting from a Wahoo Trainer.
Further reverse engineering of the Wahoo spec.