Im sure Im missing something simple... how do I show clock on preference?


(David P.) #1

Hi,

I am working on a smartapp and the last thing I am adding is the ability to choose when it runs. I am trying to mimic the time selection in the lighting app. I have the sunrise / sunset with offset done. Now I am trying to add a time selection that pops up the clock.

I can’t find any docs on how to pop up that clock to select the time from. I swear a few days ago I cut and paste a snippet that did that while testing things but now I don’t seem to find it. I know Groovy supports a timepicker but I am not seeing that in smartthings docs or examples either.

Any tips on where to look or anyone know the input type for that? I have already tried “time” but it just asks you to enter the values.

This is the input code:

			input ("StartTime", type: "time", title: "Enter Start Time:"	, required: true	)

Thanks


(David P.) #2

Wow ok I dug and dug for hours Last night and then today and couldn’t find anything and ran across a line in the code lock sample and modified it to this:

input (name: “SpecificEndTime”, type: “time” , title: “Enter End Time:” , description: null, required: true)

Other than the name: tagging the first part of the label and the description: null entry they are the same but now I get a clock picker instead of a keyboard asking me to enter the value.