mirror of
https://github.com/nymea/nymea-plugins.git
synced 2026-07-18 00:43:48 +02:00
Merge PR #66: Elgato/Avea: Fix handling white channel in set color action
This commit is contained in:
commit
9047914e33
@ -106,6 +106,7 @@ bool AveaBulb::setColor(const QColor &color)
|
||||
m_red = scaleColorValueUp(color.red());
|
||||
m_green = scaleColorValueUp(color.green());
|
||||
m_blue = scaleColorValueUp(color.blue());
|
||||
m_white = scaleColorValueUp(color.alpha());
|
||||
|
||||
m_color = color;
|
||||
|
||||
|
||||
@ -493,6 +493,7 @@ DeviceManager::DeviceError DevicePluginElgato::executeAction(Device *device, con
|
||||
return DeviceManager::DeviceErrorNoError;
|
||||
} else if (action.actionTypeId() == aveaColorActionTypeId) {
|
||||
QColor color = action.param(aveaColorActionColorParamTypeId).value().value<QColor>();
|
||||
color.setAlpha(0); // Alpha is white
|
||||
if (!bulb->setColor(color))
|
||||
return DeviceManager::DeviceErrorHardwareNotAvailable;
|
||||
|
||||
@ -513,7 +514,8 @@ DeviceManager::DeviceError DevicePluginElgato::executeAction(Device *device, con
|
||||
color.setRed(red);
|
||||
color.setGreen(0);
|
||||
color.setBlue(blue);
|
||||
if (!bulb->setWhite(4095) || !bulb->setColor(color)) {
|
||||
color.setAlpha(255); // Alpha is white
|
||||
if (!bulb->setColor(color)) {
|
||||
return DeviceManager::DeviceErrorHardwareNotAvailable;
|
||||
}
|
||||
device->setStateValue(aveaColorStateTypeId, color);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user