Skip to content

Commit a0b243c

Browse files
committed
add horizon 5r resistance table
1 parent fce38ca commit a0b243c

7 files changed

Lines changed: 254 additions & 1 deletion

File tree

src/devices/bluetooth.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
19261926
(b.name().toUpper().startsWith("BESP-")) || // FITFIU BESP 250 indoor bike
19271927
(b.name().toUpper().startsWith("GLT") && deviceHasService(b, QBluetoothUuid((quint16)0x1826))) ||
19281928
(b.name().toUpper().startsWith("SPORT01-") && deviceHasService(b, QBluetoothUuid((quint16)0x1826))) || // Labgrey Magnetic Exercise Bike https://www.amazon.co.uk/dp/B0CXMF1NPY?_encoding=UTF8&psc=1&ref=cm_sw_r_cp_ud_dp_PE420HA7RD7WJBZPN075&ref_=cm_sw_r_cp_ud_dp_PE420HA7RD7WJBZPN075&social_share=cm_sw_r_cp_ud_dp_PE420HA7RD7WJBZPN075&skipTwisterOG=1
1929+
(b.name().toUpper().startsWith("FS-IB")) ||
19291930
(b.name().toUpper().startsWith("FS-YK-")) ||
19301931
(b.name().toUpper().startsWith("T600E_")) ||
19311932
(b.name().toUpper().startsWith("SPEEDBIKE S2")) || // Maxxus Speedbike S2

src/devices/ftmsbike/ftmsbike.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "ftmsbike.h"
22
#include "devices/cscbike/cscbike.h"
3+
#include "horizon5r_defaults.h"
34
#include "speedracex_defaults.h"
45
#include "homeform.h"
56
#include "virtualdevices/virtualbike.h"
@@ -2123,6 +2124,12 @@ void ftmsbike::deviceDiscovered(const QBluetoothDeviceInfo &device) {
21232124
ergModeSupported = false;
21242125
Resistance = 1;
21252126
max_resistance = cscbike::customResistanceMax();
2127+
} else if(device.name().toUpper().startsWith("FS-IB")) {
2128+
qDebug() << QStringLiteral("FS-IB found");
2129+
resistance_lvl_mode = true;
2130+
ergModeSupported = false;
2131+
max_resistance = 100;
2132+
_ergTable.loadDefaultData(kHorizon5RDefaultErgData);
21262133
} else if(device.name().toUpper().startsWith("FS-YK-")) {
21272134
qDebug() << QStringLiteral("FS-YK- found");
21282135
FS_YK = true;

src/devices/ftmsbike/horizon5r_defaults.h

Lines changed: 237 additions & 0 deletions
Large diffs are not rendered by default.

src/qdomyos-zwift.pri

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ fit-sdk/fit_zones_target_mesg.hpp \
784784
fit-sdk/fit_zones_target_mesg_listener.hpp \
785785
devices/flywheelbike/flywheelbike.h \
786786
devices/ftmsbike/ftmsbike.h \
787+
devices/ftmsbike/horizon5r_defaults.h \
787788
devices/ftmsbike/speedracex_defaults.h \
788789
devices/heartratebelt/heartratebelt.h \
789790
homeform.h \

tst/Devices/deviceindex.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ DEFINE_DEVICE(FTMSBikeHammerRacerS, "FTMS Bike Hammer Racer S");
6868
DEFINE_DEVICE(FTMSBike, "FTMS Bike");
6969
DEFINE_DEVICE(FTMSBike2, "FTMS Bike 2");
7070
DEFINE_DEVICE(FTMSBike3, "FTMS Bike 3");
71+
DEFINE_DEVICE(FTMSBikeHorizon5R, "FTMS Bike Horizon 5.0R");
7172
DEFINE_DEVICE(FTMSKICKRCORE, "FTMS KICKR CORE");
7273
DEFINE_DEVICE(FTMSRower, "FTMS Rower");
7374
DEFINE_DEVICE(FakeBike, "Fake Bike");

tst/Devices/deviceindex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ class DeviceIndex
7373
DEFINE_DEVICE(FTMSBike, "FTMS Bike");
7474
DEFINE_DEVICE(FTMSBike2, "FTMS Bike 2");
7575
DEFINE_DEVICE(FTMSBike3, "FTMS Bike 3");
76+
DEFINE_DEVICE(FTMSBikeHorizon5R, "FTMS Bike Horizon 5.0R");
7677
DEFINE_DEVICE(FTMSKICKRCORE, "FTMS KICKR CORE");
7778
DEFINE_DEVICE(FTMSRower, "FTMS Rower");
7879
DEFINE_DEVICE(FakeBike, "Fake Bike");
@@ -179,4 +180,3 @@ class DeviceIndex
179180

180181
};
181182

182-

tst/Devices/devicetestdataindex.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,12 @@ void DeviceTestDataIndex::Initialize() {
658658
->excluding(ftmsBikeConfigureExclusions)
659659
->configureSettingsWith(QBluetoothUuid((quint16)0x1826));
660660

661+
// FTMS Bike Horizon 5.0R (advertises with FS-IB prefix)
662+
RegisterNewDeviceTestData(DeviceIndex::FTMSBikeHorizon5R)
663+
->expectDevice<ftmsbike>()
664+
->acceptDeviceName("FS-IB", DeviceNameComparison::StartsWithIgnoreCase)
665+
->excluding(ftmsBikeConfigureExclusions);
666+
661667
// FTMS Rower
662668
RegisterNewDeviceTestData(DeviceIndex::FTMSRower)
663669
->expectDevice<ftmsrower>()

0 commit comments

Comments
 (0)