Enum in SmartApp IDE simulator – bug?

smartapp
bug
ide

#1

It seems there are at least two bugs with the IDE simulator and enum preferences.

Consider this example preference definition:

preferences {
    section("Title") {
        input name: "o1", type: "enum", title: "Test 1", options: ["Yes", "No"], defaultValue: "No", required: false
    	input name: "o2", type: "enum", title: "Test 2", options: ["Yes", "No"], defaultValue: "Yes", required: false
    	input name: "o3", type: "enum", title: "Test 3", options: ["Yes", "No"], defaultValue: "No", required: true
    	input name: "o4", type: "enum", title: "Test 4", options: ["Yes", "No"], defaultValue: "Yes", required: true
    }
}

and

def initialize() {
	log.debug "settings.o1 $settings.o1"
	log.debug "settings.o2 $settings.o2"
	log.debug "settings.o3 $settings.o3"
	log.debug "settings.o4 $settings.o4"
}

First, the simulator does not seem to honour the defaultValue argument, selecting 'Yes', the first option, in all cases.
But worse, the value reported in initialize differs from what happens in an actually installed app: Apps interfaced through the iOS app report the string value of the selected option. The IDE simulator seems to report the first option as text ('Yes'), the second one as '1' (index as string).


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

The IDE Simulator has lots of bugs.

I live by a single mantra: Never trust the IDE simulator. It is much less frustrating to test by self-publishing to the mobile app.


#3

I guess it does. I’ve had the SmartThings Hub for a while now, but only recently tackled writing some apps. Do these bugs get fixed eventually? Does anyone care?


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #4
  1. If by “these bugs” you mean many similar examples in the past: Yes. (NB: “eventually” is is not legally binding; neither is “a few weeks”, or even “by the end of the year”).

  2. If by “anyone care” you mean that SmartThings engineers care that these bugs exist and would like to fix them: Yes.


#5

Is there a (public) bug tracker that would help us help SmartThings fix bugs? If it is, it’s not in a prominent position …


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #6

Dream on.

(There is one created by the Community, though it’s worse than useless: http://thingsthataresmart.wiki/index.php?title=Category:Known_System_Issues )


(Eric Mayers) #7

I’m seeing this behavior too – namely enum behavior being wonky in the simulator.


#8

I know this was initiated in 2016 but I just ran into this “bug” in ST. I have an method using enum to select months I want the app to run. I noticed after much debugging that the ST hub sees my multiple selections as January, March, April (for example) but the simulator sees that input as January, 02, 03. After I finally figured out what was happening, I added code to get the input correct regardless of Hub or simulator.