Merge branch 'audioreactive-prototype' of https://github.com/blazoncek/WLED into merge-audio

This commit is contained in:
Blaž Kristan
2022-08-22 10:34:10 +02:00
7 changed files with 735 additions and 670 deletions

View File

@@ -275,12 +275,12 @@ class PWMFanUsermod : public Usermod {
enabled = usermod[FPSTR(_enabled)].as<bool>();
if (!enabled) updateFanSpeed(0);
}
if (!usermod[FPSTR(_speed)].isNull() && usermod[FPSTR(_speed)].is<int>()) {
if (enabled && !usermod[FPSTR(_speed)].isNull() && usermod[FPSTR(_speed)].is<int>()) {
pwmValuePct = usermod[FPSTR(_speed)].as<int>();
updateFanSpeed((MAX(0,MIN(100,pwmValuePct)) * 255) / 100);
updateFanSpeed((constrain(pwmValuePct,0,100) * 255) / 100);
if (pwmValuePct) lockFan = true;
}
if (!usermod[FPSTR(_lock)].isNull() && usermod[FPSTR(_lock)].is<bool>()) {
if (enabled && !usermod[FPSTR(_lock)].isNull() && usermod[FPSTR(_lock)].is<bool>()) {
lockFan = usermod[FPSTR(_lock)].as<bool>();
}
}