Skip to content

Commit

Permalink
Fix LED colors adjustments by configuration name (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
awawa-dev authored Oct 11, 2024
1 parent 8da1486 commit a15126e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sources/led-strip/LedCalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ QJsonArray LedCalibration::getAdjustmentState() const
void LedCalibration::updateConfig(const QJsonObject& adjustment)
{
if (_calibrationConfig.size() > 0)
{
const QString adjustmentId = adjustment["id"].toString(_calibrationConfig.front()->getId());

for (auto colorAdjustment = _calibrationConfig.cbegin(); colorAdjustment != _calibrationConfig.cend(); ++colorAdjustment)
if (adjustmentId == (*colorAdjustment)->getId())
{
(*colorAdjustment)->updateConfig(adjustment);
return;
}


_calibrationConfig.front()->updateConfig(adjustment);
}
}

0 comments on commit a15126e

Please sign in to comment.