Skip to content

Commit e26ba79

Browse files
authored
Fix throttle curve backwards compatibility (#4478)
1 parent 9f72b8a commit e26ba79

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/js/tabs/pid_tuning.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,12 @@ pid_tuning.initialize = function (callback) {
16871687
const throttleLimitTypeE = $('.throttle_limit select[id="throttleLimitType"]');
16881688
const mid = parseFloat(throttleMidE.val()); // Value 0-1
16891689
const expo = parseFloat(throttleExpoE.val()); // Value 0-1
1690-
const hover = parseFloat(throttleHoverE.val()); // Value 0-1 (hover throttle %)
1690+
1691+
// Hover parameter is only available from 1.47 so use mid value for older versions
1692+
const hover = semver.gte(FC.CONFIG.apiVersion, API_VERSION_1_47)
1693+
? parseFloat(throttleHoverE.val())
1694+
: mid;
1695+
16911696
const throttleLimitPercent = parseInt(throttleLimitPercentE.val()) / 100; // Value 0-1
16921697
const throttleLimitType = parseInt(throttleLimitTypeE.val());
16931698
const throttleCurve = $(".throttle .throttle_curve canvas").get(0);

0 commit comments

Comments
 (0)