mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Update JsonClientConnection.cpp
Former-commit-id: fef896ef86f04901cf2227a0897dd9ea999325b7
This commit is contained in:
parent
642de44c7c
commit
b46d231f75
@ -595,20 +595,12 @@ void JsonClientConnection::handleCorrectionCommand(const Json::Value &message)
|
||||
return;
|
||||
}
|
||||
|
||||
if (correction.isMember("red"))
|
||||
if (correction.isMember("correctionValues"))
|
||||
{
|
||||
colorCorrection->_rgbCorrection.setcorrectionR(correction["red"].asInt());
|
||||
}
|
||||
|
||||
if (correction.isMember("green"))
|
||||
{
|
||||
colorCorrection->_rgbCorrection.setcorrectionG(correction["green"].asInt());
|
||||
}
|
||||
|
||||
if (correction.isMember("blue"))
|
||||
{
|
||||
colorCorrection->_rgbCorrection.setcorrectionB(correction["blue"].asInt());
|
||||
}
|
||||
const Json::Value & values = correction["correctionValues"];
|
||||
colorCorrection->_rgbCorrection.setcorrectionR(values[0u].asInt());
|
||||
colorCorrection->_rgbCorrection.setcorrectionG(values[1u].asInt());
|
||||
colorCorrection->_rgbCorrection.setcorrectionB(values[2u].asInt());
|
||||
|
||||
// commit the changes
|
||||
_hyperion->correctionsUpdated();
|
||||
@ -628,20 +620,12 @@ void JsonClientConnection::handleTemperatureCommand(const Json::Value &message)
|
||||
return;
|
||||
}
|
||||
|
||||
if (temperature.isMember("red"))
|
||||
if (temperature.isMember("correctionValues"))
|
||||
{
|
||||
colorTemperature->_rgbCorrection.setcorrectionR(temperature["red"].asInt());
|
||||
}
|
||||
|
||||
if (temperature.isMember("green"))
|
||||
{
|
||||
colorTemperature->_rgbCorrection.setcorrectionG(temperature["green"].asInt());
|
||||
}
|
||||
|
||||
if (temperature.isMember("blue"))
|
||||
{
|
||||
colorTemperature->_rgbCorrection.setcorrectionB(temperature["blue"].asInt());
|
||||
}
|
||||
const Json::Value & values = temperature["correctionValues"];
|
||||
colorTemperature->_rgbCorrection.setcorrectionR(values[0u].asInt());
|
||||
colorTemperature->_rgbCorrection.setcorrectionG(values[1u].asInt());
|
||||
colorTemperature->_rgbCorrection.setcorrectionB(values[2u].asInt());
|
||||
|
||||
// commit the changes
|
||||
_hyperion->temperaturesUpdated();
|
||||
|
Loading…
Reference in New Issue
Block a user