sensors-swift-wahoo

Wahoo Trainer Extension for Swifty Sensors

2 years after

Wahoo Extension for Swifty Sensors

iOS macOS Swift 3.0 License CocoaPods

This Swifty Sensor extension adds a Wahoo Trainer Characteristic to the Cycling Power Service for controlling Wahoo Trainers (KICKR and KICKR SNAP).

Installation

CocoaPods

use_frameworks!
pod 'SwiftySensorsWahoo'

Manual

Coming Soon

Carthage

Coming Soon

Swift Package Manager

Coming Soon

Usage

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)

Known bugs

There is an occassional crash when disconnecting from a Wahoo Trainer.

ToDos

Further reverse engineering of the Wahoo spec.