Compare commits

..

4 Commits

Author SHA1 Message Date
jonasbark
9bb0e5616a Aktualisieren von pubspec.yaml 2025-09-11 19:27:47 +02:00
jonasbark
7e98f595ee Aktualisieren von CHANGELOG.md 2025-09-11 19:27:18 +02:00
Jonas Bark
a9fdc4b16e attempt to add support for Zwift Click v2 2025-09-10 17:40:14 +02:00
Jonas Bark
c06819b502 attempt to add support for Zwift Click v2 2025-09-10 08:42:55 +02:00
6 changed files with 17 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
### 2.2.1 (2025-09-09) BETA
- Attempt to add support for latest Zwift Click v2
### 2.3.0 (2025-09-11)
- Add support for latest Zwift Click v2
### 2.2.0 (2025-09-08)
- Add Long Press Mode option for custom keymaps - buttons can now send sustained key presses instead of repeated taps, perfect for movement controls in games (fixes #61)

View File

@@ -23,7 +23,9 @@ class Constants {
static const BC1 = 0x09;
// Zwift Click v2 Right (unconfirmed)
static const CLICK_RIGHT_SIDE = 0x0A;
static const CLICK_V2_RIGHT_SIDE = 0x0A;
// Zwift Click v2 Right (unconfirmed)
static const CLICK_V2_LEFT_SIDE = 0x0B;
static final RIDE_ON = Uint8List.fromList([0x52, 0x69, 0x64, 0x65, 0x4f, 0x6e]);
static final VIBRATE_PATTERN = Uint8List.fromList([0x12, 0x12, 0x08, 0x0A, 0x06, 0x08, 0x02, 0x10, 0x00, 0x18]);
@@ -50,6 +52,7 @@ class Constants {
enum DeviceType {
click,
clickV2Right,
clickV2Left,
playLeft,
playRight,
rideRight,
@@ -65,8 +68,10 @@ enum DeviceType {
switch (data) {
case Constants.BC1:
return DeviceType.click;
case Constants.CLICK_RIGHT_SIDE:
case Constants.CLICK_V2_RIGHT_SIDE:
return DeviceType.clickV2Right;
case Constants.CLICK_V2_LEFT_SIDE:
return DeviceType.clickV2Left;
case Constants.RC1_LEFT_SIDE:
return DeviceType.playLeft;
case Constants.RC1_RIGHT_SIDE:

View File

@@ -42,7 +42,7 @@ abstract class BaseDevice {
//'Zwift Ride' => ZwiftRide(scanResult), special case for Zwift Ride: we must only connect to the left controller
// https://www.makinolo.com/blog/2024/07/26/zwift-ride-protocol/
'Zwift Play' => ZwiftPlay(scanResult),
//'Zwift Click' => ZwiftClick(scanResult), special case for Zwift Click v2: we must only connect to the right controller
//'Zwift Click' => ZwiftClick(scanResult), special case for Zwift Click v2: we must only connect to the left controller
_ => null,
};
@@ -62,9 +62,10 @@ abstract class BaseDevice {
DeviceType.click => ZwiftClick(scanResult),
DeviceType.playRight => ZwiftPlay(scanResult),
DeviceType.playLeft => ZwiftPlay(scanResult),
//DeviceType.rideRight => ZwiftRide(scanResult), // see comment above
DeviceType.rideLeft => ZwiftRide(scanResult),
DeviceType.clickV2Right => ZwiftClickV2(scanResult),
//DeviceType.rideRight => ZwiftRide(scanResult), // see comment above
DeviceType.clickV2Left => ZwiftClickV2(scanResult),
//DeviceType.clickV2Right => ZwiftClickV2(scanResult), // see comment above
_ => null,
};
}

View File

@@ -1,5 +1,5 @@
import 'package:swift_control/bluetooth/devices/zwift_play.dart';
import 'package:swift_control/bluetooth/devices/zwift_ride.dart';
class ZwiftClickV2 extends ZwiftPlay {
class ZwiftClickV2 extends ZwiftRide {
ZwiftClickV2(super.scanResult);
}

View File

@@ -91,7 +91,7 @@ class _AppTitleState extends State<AppTitle> {
Text('SwiftControl'),
if (_packageInfoValue != null)
Text(
'v${_packageInfoValue!.version}',
'v${_packageInfoValue!.version}+${_packageInfoValue!.buildNumber}',
style: TextStyle(fontFamily: "monospace", fontFamilyFallback: <String>["Courier"], fontSize: 12),
)
else

View File

@@ -1,7 +1,7 @@
name: swift_control
description: "SwiftControl - Control your virtual riding"
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 2.2.1+1
version: 2.3.0+0
environment:
sdk: ^3.7.0