Hi!
Is there any way to add and if/else clause (or similar) to show differents parameters for the same label taking into consideration the DeviceId.ProductClass?
I’ve been looking into the docs and I think the intended way to do this is using VirtualParamerts, right?
Using the example above the code for this VirtualParameter is:
const now = Date.now();
let productClass = declare("DeviceID.ProductClass", {value: 1}).value[0];
let client = "";
switch(productClass) {
case "model1":
client = declare("InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANPPPConnection.1.Username", {value: now}).value[0];
break;
case "model2":
client = declare("InternetGatewayDevice.WANDevice.2.WANConnectionDevice.1.WANPPPConnection.1.Username", {value: now}).value[0];
break;
case "model3":
client = declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.2.WANPPPConnection.1.Username", {value: now}).value[0];
break;
default:
client = "not supported";
}
return {writable: false, value: [client, "xsd:string"]};
model1 and model2 use the same parameter, model 3 uses another.
Any thoughts? Could this be done more efficiently?