Skip to content

Commit

Permalink
Added "alert" action for groups via GET
Browse files Browse the repository at this point in the history
  • Loading branch information
SwoopX committed Jun 27, 2020
1 parent 0531a9a commit 903ee5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Group::Group() :
colorY = 0;
colorTemperature = 0;
colormode = QLatin1String("hs");
alert = QLatin1String("none");

// add common items
addItem(DataTypeString, RAttrName);
Expand Down
1 change: 1 addition & 0 deletions group.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Group : public Resource
uint16_t colorTemperature;
QString etag;
QString colormode;
QString alert;
std::vector<Scene> scenes;
QTime sendTime;
bool hidden;
Expand Down
2 changes: 2 additions & 0 deletions rest_groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,7 @@ int DeRestPluginPrivate::setGroupState(const ApiRequest &req, ApiResponse &rsp)
return REQ_READY_SEND;
}

group->alert = QLatin1String(alert);
taskToLocalData(task);

if ((task.taskType == TaskIdentify && addTaskIdentify(task, task.identifyTime)) ||
Expand Down Expand Up @@ -1805,6 +1806,7 @@ bool DeRestPluginPrivate::groupToMap(const ApiRequest &req, const Group *group,
action["bri"] = (double)group->level;
action["sat"] = (double)group->sat;
action["ct"] = (double)group->colorTemperature;
action["alert"] = QLatin1String(group->alert);
QVariantList xy;

double colorX = group->colorX;
Expand Down

0 comments on commit 903ee5a

Please sign in to comment.