Allow modification of sensor/config/reachable only for CLIP sensors
@@ -678,6 +678,8 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
return REQ_READY_SEND;
}
+ bool isClip = sensor->type().startsWith(QLatin1String("CLIP"));
+
userActivity();
//check invalid parameter
@@ -689,8 +691,16 @@ int DeRestPluginPrivate::changeSensorConfig(const ApiRequest &req, ApiResponse &
ResourceItemDescriptor rid;
ResourceItem *item = 0;
if (getResourceItemDescriptor(QString("config/%1").arg(pi.key()), rid))
+ {
+ if (!isClip && rid.suffix == RConfigReachable)
+ {
+ // changing reachable of zigbee sensors is not allowed, trigger error
+ }
+ else
{
item = sensor->item(rid.suffix);
+ }
+
if (item)
{
QVariant val = map[pi.key()];
