Can anyone enlighten me as to what constitutes a valid Luup variable name? I’ve successfully (by accident) created names with spaces, so it’s obviously more than alphanumeric, but what about other characters? What about length of the name?? Does this follow some sort of UPnP standard???
This is not an idle musing, I’m chasing an error which might be something to do with this.
@Brientim had the right answer for the question … but I am assuming that this was not the right question. LUA will fail to compile your statement if the variable name is wrong.
@futzle was referring the luup.variable_set or device state variables.
The basic device state variables software that runs in VERA probably does not care anything about what the name is. I am sure the names are looked at using a hash table or a string comparison. However that data is passed to many other components (as xml or json) … and then presented to user interface (html) and they may have problems.
If you followed the rules for real LUA variable names … you will be in good shape for all of these other layers.
…and that, indeed, was the meaning of my rather poorly posed question. I should also make it clear that it’s not simply perversion which leads me to possibly bizarre variable names, but the fact that they are constructed from free text set elsewhere by A.N.Other, so I need to filter out the dross.
The basic device state variables software that runs in VERA probably does not care anything about what the name is. I am sure the names are looked at using a hash table or a string comparison.
...a fair guess.
However that data is passed to many other components (as xml or json) ... and then presented to user interface (html) and they may have problems.
...which takes us back to @futzle's advice.
If you followed the rules for real LUA variable names ... you will be in good shape for all of these other layers.
...a conservative approach which is probably also GOOD ADVICE and in line with @Brientim.
I kind of hoped that it might be defined somewhere. Silly me.
If MCV decided to adhere to the UPnP spec for rules regarding variable names, then the answer can be found in the file documents/UPnP_Service_Checklist1.01.pdf in the upnpresources.zip file available from [url=http://upnp.org/resources/upnpresources.zip]http://upnp.org/resources/upnpresources.zip[/url].
____ 3. State Variable names are compliant with UPnP naming conventions
a) Are descriptive of the state variable?s function, < 32 Characters
b) Capitalize the first letter of each word used in the name
c) Do not use reserved prefixes (X_ or A_ ) except as intended