From 2e95fb556adef00f9fcca8ff1f4df2f0718bc76a Mon Sep 17 00:00:00 2001 From: Jonas Bark Date: Sun, 26 Oct 2025 20:54:53 +0100 Subject: [PATCH] don't reset in debug mode --- lib/bluetooth/devices/zwift/zwift_ride.dart | 4 +++- lib/pages/device.dart | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/bluetooth/devices/zwift/zwift_ride.dart b/lib/bluetooth/devices/zwift/zwift_ride.dart index 972d920..7c13540 100644 --- a/lib/bluetooth/devices/zwift/zwift_ride.dart +++ b/lib/bluetooth/devices/zwift/zwift_ride.dart @@ -65,7 +65,9 @@ class ZwiftRide extends ZwiftDevice { 'Your Zwift Click V2 no longer sends events. Connect it in the Zwift app once per day. Resetting the device now.', ), ); - sendCommand(Opcode.RESET, null); + if (!kDebugMode) { + sendCommand(Opcode.RESET, null); + } } switch (opcode) { diff --git a/lib/pages/device.dart b/lib/pages/device.dart index db423f7..8b3fe95 100644 --- a/lib/pages/device.dart +++ b/lib/pages/device.dart @@ -230,6 +230,13 @@ class _DevicePageState extends State with WidgetsBindingObserver { }, child: Text('Troubleshooting'), ), + if (kDebugMode) + TextButton( + onPressed: () { + (connection.bluetoothDevices.first as ZwiftClickV2).test(); + }, + child: Text('Test'), + ), ], ), ],