add ubisys J1 { "bri_inc": 0 } translates to stop command.
@@ -934,6 +934,28 @@ int DeRestPluginPrivate::setLightState(const ApiRequest &req, ApiResponse &rsp)
{
rsp.list.append(errorToMap(ERR_PARAMETER_NOT_AVAILABLE, QString("/lights/%1").arg(id), QString("parameter, /lights/%1/bri_inc, is not available.").arg(id)));
}
+ //FIXME workaround ubisys J1
+ else if (taskRef.lightNode->modelId().startsWith(QLatin1String("J1")))
+ {
+ if (ok && (map["bri_inc"].type() == QVariant::Double) && (briIinc == 0))
+ {
+ TaskItem task;
+ copyTaskReq(taskRef, task);
+ if (addTaskWindowCovering(task, 0x02 /*stop motion*/, 0, 0))
+ {
+ QVariantMap rspItem;
+ QVariantMap rspItemState;
+ rspItemState[QString("/lights/%1/state/bri").arg(id)] = item->toNumber();
+ rspItem["success"] = rspItemState;
+ rsp.list.append(rspItem);
+ taskToLocalData(task);
+ }
+ else
+ {
+ rsp.list.append(errorToMap(ERR_INTERNAL_ERROR, QString("/lights/%1").arg(id), QString("Internal error, %1").arg(ERR_BRIDGE_BUSY)));
+ }
+ }
+ } // FIXME end workaround ubisys J1
else if (!isOn)
{
rsp.list.append(errorToMap(ERR_DEVICE_OFF, QString("/lights/%1").arg(id), QString("parameter, /lights/%1/bri, is not modifiable. Device is set to off.").arg(id)));
