introduce workaround for Zwift Click V2 (reset every minute)

This commit is contained in:
Jonas Bark
2025-10-01 16:17:20 +02:00
parent 5c8db11536
commit f83defb37b
5 changed files with 37 additions and 29 deletions

View File

@@ -160,8 +160,7 @@ jobs:
- name: Upload to Play Store
# only upload when env.VERSION does not end with 1337, which is our indicator for beta releases
#if: "!endsWith(env.VERSION, '1337')"
if: false
if: "!endsWith(env.VERSION, '1337')"
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}

View File

@@ -1,5 +1,6 @@
### 2.6.1 (2025-10-01)
- fix a few issues with the new touch placement feature
- add a workaround for Zwift Click V2 which resets the device when button events are no longer sent
### 2.6.0 (2025-09-30)
- refactor touch placements: show touches on screen, fix misplaced coordinates - should fix #64

View File

@@ -1,9 +1,9 @@
import 'dart:typed_data';
import 'package:swift_control/bluetooth/devices/zwift_ride.dart';
import 'package:swift_control/bluetooth/protocol/zp.pb.dart';
import '../ble.dart';
import '../protocol/zp.pbenum.dart';
class ZwiftClickV2 extends ZwiftRide {
ZwiftClickV2(super.scanResult);
@@ -44,27 +44,27 @@ class ZwiftClickV2 extends ZwiftRide {
0x00,
0x0A,
0x15,
0x40,
0xE9,
0xD9,
0xC9,
0x6B,
0x74,
0x63,
0xC2,
0x7F,
0x1B,
0x4E,
0x4D,
0x9F,
0x1C,
0xB1,
0x20,
0x5D,
0x88,
0x2E,
0xD7,
0xCE,
0x63,
0x24,
0x0A,
0x31,
0xD6,
0xC6,
0xB8,
0x1F,
0xC1,
0x29,
0xD6,
0xA4,
0xE9,
0x9D,
0xFF,
0xFC,
0xB9,
0xFC,
0x41,
0x8D,
]),
);*/
}

View File

@@ -2,6 +2,7 @@ import 'package:dartx/dartx.dart';
import 'package:flutter/foundation.dart';
import 'package:protobuf/protobuf.dart' as $pb;
import 'package:swift_control/bluetooth/devices/base_device.dart';
import 'package:swift_control/bluetooth/devices/zwift_clickv2.dart';
import 'package:swift_control/bluetooth/messages/ride_notification.dart';
import 'package:swift_control/bluetooth/protocol/zp_vendor.pb.dart';
import 'package:swift_control/utils/keymap/buttons.dart';
@@ -77,10 +78,15 @@ class ZwiftRide extends BaseDevice {
);
}
if (bytes.startsWith(Constants.RESPONSE_STOPPED_CLICK_V2)) {
if (bytes.startsWith(Constants.RESPONSE_STOPPED_CLICK_V2) && this is ZwiftClickV2) {
actionStreamInternal.add(
LogNotification('Your Zwift Click V2 no longer sends events. Connect it in the Zwift app once per day.'),
LogNotification(
'Your Zwift Click V2 no longer sends events. Connect it in the Zwift app once per day. Resetting the device now.',
),
);
if (!kDebugMode) {
sendCommand(Opcode.RESET, null);
}
}
switch (opcode) {

View File

@@ -78,10 +78,12 @@ class _DevicePageState extends State<DevicePage> {
),
padding: const EdgeInsets.all(8),
child: Text(
'''To make your Zwift Click V2 work properly you need to connect it to with in the Zwift app once each day:
'''To make your Zwift Click V2 work best you should connect it in the Zwift app once each day.\nIf you don't do that SwiftControl will need to reconnect every minute.
1. Open Zwift app
2. After logging in (subscription not required) find it in the device connection screen and connect it
3. Close the Zwift app again and connect again in SwiftControl''',
2. Log in (subscription not required) and open the device connection screen
3. Connect your Trainer, then connect the Zwift Click V2
4. Close the Zwift app again and connect again in SwiftControl''',
),
),
Text(
@@ -207,7 +209,7 @@ ${it.firmwareVersion != null ? ' - Firmware Version: ${it.firmwareVersion}' : ''
onPressed: () {
(connection.devices.first as ZwiftClickV2).test();
},
child: Text('Reset'),
child: Text('Test'),
),
],
),