luup.devices members

So in developing a new plugin I need to store a username and password. The members of luup.devices includes user and pass, but how do I set these from the UI5 interface? Under the advanced tab of the device I can see some of the members (ip, mac, etc) but some are missing (user, pass). I would like to make use of these “built-in” members instead of setting my own variables that would presumably duplicate the functionality.

You would use the variableset Luup command:

http://wiki.micasaverde.com/index.php/Luup_Requests#variableset

  • Garrett

[quote=“garrettwp, post:2, topic:171005”]You would use the variableset Luup command:

http://wiki.micasaverde.com/index.php/Luup_Requests#variableset[/quote]

I dont mean from code, I mean from the user interface. How would a user set the user or pass values? There is no place for them to enter it like there is for ip. If I define my own variables that works just fine, but if there is already something in place for it, Id like to use that.

If it it’s not listed in the device advanced tab, you’ll have to add it in the text boxes at the bottom of the screen of the advanced tab.

  • Garrett

Can someone update the documentation at http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#variable:_devices then? The way it is described there it seems I should be able to make use of any of those “built-in” varriables.

Use the luup.attr_set function in the startup function to initialize those fields with the empty string to make them show up in the Advanced tab:

luup.attr_set("username", "", deviceId)
luup.attr_set("password", "", deviceId)