I have an Indigo Virtual Device that controls a relay using SNMP. The interface script returns 0 for off and 1 for on. This status is stored in an Indigo variable. So far, so good.
Now the problem. It seems the Indigo Virtual Device code does not recognize 0 and 1 as legal states for the device state heuristic. That is, the State column displays the state value as a literal 0 or 1 and the device state icon is always displayed as a red circle. It would seem to me a Virtual Device should either automatically recognize status variable values of 0 & 1 as states or should allow the user the option to define the On and Off values.
Is this...a) a bug; b) a feature request; or c) something else?
Also... I noticed that when capturing output from the command line (run shell script) to store in an Indigo status variable, the trailing newline is also captured and stored. This breaks true/false tests on that variable. Case in point, to solve the issue noted above, I created a couple of triggers to modify a new (state display) variable to be On or Off based on changes in my stored device status of 0 or 1. When I manually changed the variable value, it worked. But, when the external code output was captured, nothing happened. I suppressed the newline in the python interface script and it all worked.
Update: The main problem is resolved. It was caused by the presence of the newline. See my follow-up post in response to @howartp