Reintroduce colorcapabilities as array  for API version v1.1
For clients with v1.0 this won't be a breaking change and colorcapabilities still returns a number.
Clients which support v1.1 need to support colorcapabilities as array.
Related PR
@@ -252,8 +252,8 @@ bool DeRestPluginPrivate::lightToMap(const ApiRequest &req, const LightNode *lig
else if (item->descriptor().suffix == RStateReachable) { state["reachable"] = item->toBool(); }
else if (item->descriptor().suffix == RConfigCtMin) { map["ctmin"] = item->toNumber(); }
else if (item->descriptor().suffix == RConfigCtMax) { map["ctmax"] = item->toNumber(); }
- else if (item->descriptor().suffix == RConfigColorCapabilities) { map["colorcapabilities"] = item->toNumber(); }
-// else if (item->descriptor().suffix == RConfigColorCapabilities) { icc = item; } // TODO enable again in beta v2.6.x
+ else if (req.apiVersion() <= ApiVersion_1_DDEL && item->descriptor().suffix == RConfigColorCapabilities) { map["colorcapabilities"] = item->toNumber(); }
+ else if (req.apiVersion() >= ApiVersion_1_1_DDEL && item->descriptor().suffix == RConfigColorCapabilities) { icc = item; }
else if (item->descriptor().suffix == RConfigPowerup) { map["powerup"] = item->toNumber(); }
else if (item->descriptor().suffix == RConfigPowerOnLevel) { map["poweronlevel"] = item->toNumber(); }
else if (item->descriptor().suffix == RConfigPowerOnCt) { map["poweronct"] = item->toNumber(); }
@@ -331,6 +331,15 @@ bool DeRestPluginPrivate::lightToMap(const ApiRequest &req, const LightNode *lig
QString etag = lightNode->etag;
etag.remove('"'); // no quotes allowed in string
map["etag"] = etag;
+
+ if (req.apiVersion() >= ApiVersion_2_DDEL)
+ {
+ QVariantMap links;
+ QVariantMap self;
+ self["href"] = QString("%1/%2").arg(req.hdr.url().path()).arg(lightNode->uniqueId());
+ links["self"] = self;
+ map["_links"] = links;
+ }
}
map["state"] = state;
