Developer Center > Third Party Device Driver Software Development

Choosing from a list of values in an action list item


I am writing a simple driver that will allow the use of "house modes". I saw this in another HA package and I liked the idea.

I have a database with a list of house modes, just a name and the date it was last used. I have the driver integrated into Elve and I can add a line in an action list to set the mode to something, but I have to type in the name of a mode. What I would like to do is click on the link in the list item and have it somehow show a list of all the house modes that are stored in the database and allow you to choose one. I looked at the custom editor that you can use in the <DriverSetting> attribute, but that doesn't sound like that's what I want.

I'm currently returning a ScriptArrayMarshalByValue with the list of house modes in it.

Can anyone point me to an example or documentation or something that shows me A: if it's possible to do what I want, and B: how to do it?

Thanks for your help!


Would something like this work?

Sent from my SCH-I545 using Tapatalk

I don't think that's what I'm looking to do. I'm trying to set it up so when I edit the action list (see the attached image) the link that allows setting the value currently only allows me to edit a text value, rather than letting me choose from a list of house modes that are defined.


Oh I see. Decorate with the 'ScriptObjectMethodParameter' to add static values. See below.

--- Code: ---   <ScriptObjectMethod("GUI Activate Window", "Activates the selected window", "Activate the following {NAME} window : {PARAM|0|Window}")> _
        <ScriptObjectMethodParameter("Window", "Name of the window to activate", {"home", "programs", "pictures", "filemanager", "files", "settings", "music", "video"})>
        Public Sub GUIActivateWindow(ByVal Window As ScriptString)
                Dim request As String = ControlPlayerNew("GUI.ActivateWindow", """window"" : """ & CStr(Window) & """")
            Catch ex As Exception
                Logger.Error("Failed to send the activate window request." & vbCrLf & ex.ToString)
            End Try
        End Sub

--- End code ---

Thanks for trying, but that's still not quite what I need. I need the list of choices to be dynamic. I'll be loading them from a database. I did some further searching and I did find a thread on here about someone else wanting to do the same thing, and it turns out that it's not possible, so I'm out of luck ther



[0] Message Index

Go to full version