On Wed, Mar 8, 2017 at 10:16 AM, Zaid Abdulla <[email protected]> wrote:
>
> > Second, is there an easier way of declaring values on an instance
> > than the approach I'm using?
> > //Ensure we have a WANPPPConnection instance
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*", null, {path: 1});
> > //Set the connection values
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.Name", {value: now}, {value: "Internet"});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.ConnectionType", {value: now}, {value: "IP_Routed"});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.X_BROADCOM_COM_IfName", {value: now}, {value:
> > "ppp0.1"});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.NATEnabled", {value: now}, {value: true});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.X_BROADCOM_COM_FirewallEnabled", {value: now}, {value:
> > true});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.Enable", {value: now}, {value: true});
> > declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANP
> > PPConnection.*.PPPoEServiceName", {value: now}, {value:
> > "broadband"});
>
> No, sorry :) I don't see how it can be made easier. Do you have
> something in mind?
>
> How about something like this:
let instance =
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.*",
null, {path: 1});
instance.Name = {value: "Internet", _timestamp: Date.now()};
instance.NATEnabled = {value: true, _timestamp: Date.now()};
...
_______________________________________________
Users mailing list
[email protected]
http://lists.genieacs.com/mailman/listinfo/users