possibly fixed bypass

This commit is contained in:
Daniel Sommer 2022-03-24 15:13:19 +01:00
parent 2e5bdddd15
commit 9365397b1a

View file

@ -428,12 +428,13 @@ async function toggleBypass(pedalId) {
}
const pedal = await getCurrentPedalById(pedalId);
const bypass = getBypassControlFromPedal(pedal);
let value = 0;
if (bypass.value === undefined || bypass.value === 0) {
value = 127;
bypass.value = 127;
} else {
bypass.value = 0;
}
try {
await setControl(bypass, value);
await setControl(bypass, bypass.value);
blinky.setPedalStatus(pedal);
} catch (err) {
throw new Error('could not toggle bypass for pedal ' + pedal.name + ' with id \'' + pedal.id + '\' > ' + err);