Python syntax for changing the value of a boolean variable

Posted on
Mon Aug 09, 2021 11:47 am
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Python syntax for changing the value of a boolean variable

Could someone please tell me the syntax to change an indigo variable?

Code: Select all
   indigo.variable.updateValue(269281850)


Thank you

Posted on
Mon Aug 09, 2021 12:04 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python syntax for changing the value of a boolean variab

https://wiki.indigodomo.com/doku.php?id ... e_examples

Code: Select all
indigo.variable.updateValue(269281850, "asleep")

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Aug 09, 2021 12:35 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Python syntax for changing the value of a boolean variab

Isn't 'asleep' a string? Same for 'True' , 'False'. 'y', 'N'?
or are you suggesting I'm asleep?
For strings, I'm been using the format
Code: Select all
#    indigo.variable.updateValue(1568794432, value = str("Vacant"))

Posted on
Mon Aug 09, 2021 2:26 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Python syntax for changing the value of a boolean variab

I didn't notice you wanted a boolean. All variables are strings. If you want it to be evaluated as a boolean:

True will be returned if the value is one of these: “true”, “on”, “yes”, and “1”. False will be returned if the value is one of these: “false”, “off”, “no”, and “0”. If no default value is specified and the value can't be successfully converted, the method will return False.


See https://wiki.indigodomo.com/doku.php?id ... able_class

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Aug 09, 2021 7:30 pm
SMUSEBY offline
Posts: 511
Joined: Sep 16, 2009
Location: California

Re: Python syntax for changing the value of a boolean variab

Thanks - I thought the syntax might be different from the character string syntax. I have spent so much time with the guess-and-check approach to coming up with the right python syntax - and always failing - that I skipped straight to the forum this time.
I've added it to my python syntax dictionary.
As always, thank you for your help.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests