@zaidka Has there been a change in how filters are set in the ui configs from the beta version to release? I used to be able to do this in the “Edit device page” (it’s been shortened, there is a lot more in there):
You may be interested in my solution to this issue. I didn’t like writing a bunch of one-off code to run down a list of parameters and find the one that exists for this device. So I wrote this:
const keys = [
'InternetGatewayDevice.DeviceInfo.SoftwareVersion',
'Device.DeviceInfo.SoftwareVersion'
];
return {writable: false, value: [getParameterValue(keys, ''), "xsd:string"]};
function getParameterValue(keys, def) {
for (let key of keys) {
let d = declare(key, {value: 1});
for (let item of d) {
if (item.value && item.value[0]) {
return item.value[0];
}
}
}
return def;
}
For some use-cases, the code is overly generalized, but I wanted uniformity with all my provision and vparam scripts.
This is due a change right before the final release relating to how logical operators are evaluated. Now it’s modeled after SQL so logical operators strictly return true, false, or null. But now you can use COALESCE() or CASE/WHEN expressions which give you more flexibility.