mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Changed format of proto color from bytes array to int32
Former-commit-id: 7dcf0256a81bfafb4a8f69a5a2e2a582d43a1d0d
This commit is contained in:
parent
91dcbd0758
commit
d526b8c9c1
@ -33,7 +33,7 @@
|
|||||||
"color" :
|
"color" :
|
||||||
{
|
{
|
||||||
"hsv" : {
|
"hsv" : {
|
||||||
"saturationGain" : 1.5,
|
"saturationGain" : 1.2,
|
||||||
"valueGain" : 1.5
|
"valueGain" : 1.5
|
||||||
},
|
},
|
||||||
"red" :
|
"red" :
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include <iterator>
|
#include <iterator>
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
|
#include <QRgb>
|
||||||
#include <QResource>
|
#include <QResource>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
@ -116,17 +117,13 @@ void ProtoClientConnection::handleMessage(const proto::HyperionRequest & message
|
|||||||
|
|
||||||
void ProtoClientConnection::handleColorCommand(const proto::ColorRequest &message)
|
void ProtoClientConnection::handleColorCommand(const proto::ColorRequest &message)
|
||||||
{
|
{
|
||||||
if (message.rgbcolor().size() != 3)
|
|
||||||
{
|
|
||||||
sendErrorReply("The rgbcolor field requires a length of 3");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// extract parameters
|
// extract parameters
|
||||||
int priority = message.priority();
|
int priority = message.priority();
|
||||||
int duration = message.has_duration() ? message.duration() : -1;
|
int duration = message.has_duration() ? message.duration() : -1;
|
||||||
const std::string & rgbColor = message.rgbcolor();
|
RgbColor color;
|
||||||
RgbColor color = {uint8_t(rgbColor[0]), uint8_t(rgbColor[1]), uint8_t(rgbColor[2])};
|
color.red = qRed(message.rgbcolor());
|
||||||
|
color.green = qGreen(message.rgbcolor());
|
||||||
|
color.blue = qBlue(message.rgbcolor());
|
||||||
|
|
||||||
// set output
|
// set output
|
||||||
_hyperion->setColor(priority, color, duration);
|
_hyperion->setColor(priority, color, duration);
|
||||||
|
@ -23,8 +23,8 @@ message ColorRequest {
|
|||||||
// priority to use when setting the color
|
// priority to use when setting the color
|
||||||
required int32 priority = 1;
|
required int32 priority = 1;
|
||||||
|
|
||||||
// 3-byte value containing the rgb color
|
// integer value containing the rgb color (0x00RRGGBB)
|
||||||
required bytes rgbColor = 2;
|
required int32 rgbColor = 2;
|
||||||
|
|
||||||
// duration of the request (negative results in infinite)
|
// duration of the request (negative results in infinite)
|
||||||
optional int32 duration = 3;
|
optional int32 duration = 3;
|
||||||
|
Loading…
Reference in New Issue
Block a user