VirtualParameter does not edit

I created a virtualparameter taking username from pppoe from two different brands of routers.
It’s working ok.
But when I edit the user does not change the router. There is no error.
The username parameter I can edit normal.

criei um virtualparameter pegando username do pppoe de duas marcas diferentes de roteadores.
Esta funcionando ok.
Mas quando eu edito o usuario nao modifica no roteador. Nao apresenta nenhum erro.
O parametro username eu consigo editar normal.


let m = “”;
if (args[1].value) {
m = args[1].value[0];
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.Username”, null, {value: m});
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Username”, null,{value: m});
else {
let d = declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.2.Username”, {value:});
let igd = declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANPPPConnection.1.Username”, {value:});
if (d.size) {
m = d.value[0];
else if (igd.size) {
m = igd.value[0];
return {writable: true, value: [m, “xsd:string”]};

Try this:

let username = "";
if ("value" in args[1]) {
    // Set declared value
    username = args[1].value;
    declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username", null, {value: username});
} else {
    let igd = declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.*.WANPPPConnection.*.Username", {value: 1});

    if (igd.size) {
        for (let p of igd) {
            if (p.value[0]) {
                username = p.value[0];
return {writable: true, value: [username, "xsd:string"]};

thanks for the feedback.

with this function i am getting the following errors in tasks.

too_many_commits “faultMessage =” Too many commit iterations "

I tried to change the function to:

username = args [1] .value [0];

so the tasks do not return an error, but did not change the parameter on the router.

my version: 1.2.0-beta.0+20191111024633