Question About Variable Naming

Posted on
Thu May 11, 2023 7:56 am
SearchCz offline
Posts: 172
Joined: Sep 18, 2019

Question About Variable Naming

I've set up a bunch of "virtual" devices in my Indigo setup representing all of the controllable devices in that room. I've named them "vRoom.Office", "vRoom.Lounge" etc.

For every device in my home that has on onState, I've created and maintain variables for things like the maximum number of minutes I allow that device to remain on, the number of minutes remaining until I cut the device off through scripting, the textual status message I might want to display on the control page(s) that feature that device, and so on. These variables are all named *_REM, *_MAX, *_MSG and so on, where * is the device name.

So now I have variables named vRoom.Lounge_MSG , vRoom.Office_MSG, and so on. They work fine, but I just noticed that the Indigo mac client doesn't allow me to enter variable names with the "." symbol included. Which prevents me from renaming any of these variables. Not a tragedy, but not so great.

And now my question: any reason I should be avoiding the "." symbol in my variable names???

Posted on
Thu May 11, 2023 9:42 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Question About Variable Naming

Yeah, the UI and the API naming restrictions should, of course, be the same. I don't see any reason that in the future periods will cause a problem internally. You can rename the variables using the API like this:

Code: Select all
some_var = indigo.variables[SOME_VAR_ID]
some_var.name = "newName"
some_var.replaceOnServer()

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests