Help with updateSetting for an enum

In my app I'd like to have a preference that resets at midnight. The preference is

input "testType", "enum", title: "Test Type", options:["auto", "day", "night"], required: true, submitOnChange: true

and I'm trying to reset it with

app.updateSetting("testType", [type: "enum", value: "auto"])

If I set it to "day" and then the updateSetting is run, debug before and after the updateSetting shows a value of "day" but the App Status page shows a value of ["a","u","t","o"] and if I go into the App setup again there is no value selected in the drop down.

I also tried app.updateSetting("testType", "auto" ) and that had no effect at all on the original setting.

I also tried a type of "string" on the updateSetting with no luck,Is there another field needed to change the value of an "enum"?

Thanks,
Mark

Try app.updateSetting("testType", [type:"text", value: "auto"]) This will only work on enums that are lists of strings.

But for clarification 1.1.5 did have a change that does work with type:"enum" . Please let me know if you are on 1.1.5 and still seeing this issue. I just tested your exact code and it worked.

1 Like

What software version are you on?

I'm on 1.1.4.126, I'll update this weekend!

1 Like

I believe 1.1.5 fixed the issue you ran into using app.updateSetting(.... [type: "enum".....

I've updated the hub firmware and the updateSetting works now.

Thanks everyone!
Mark