I'm attempting to add a feature with a text dropdown control in a plug-in environment. The control displays the keys in an order that is not sorted, or what was originally used to build the control. It uses a sorted dictionary, so shouldn't this display alphabetically by key?
My code to add the feature starts like this.
Dim ff = FeatureFactory.CreateFeature(pluginId)
Dim Sources As New SortedDictionary(Of String, Double) From {{"TV", 0}, {"HDMI1", 1280}, {"HDMI2", 1281}, {"HDMI3", 1282}, {"HDMI4", 1283}}
ff.OnDevice(parent.Ref)
ff.AddTextDropDown(Sources)
Dim nfd As NewFeatureData = ff.PrepareForHs()
HomeSeerSystem.CreateFeatureForDevice(nfd)
So is this a bug, or am I doing something wrong?
Also wondering if there is a way to display the key that matches the current value of the feature. When closed, the dropdown always displays TV. If this does work for others out there, it is possible that it does not work for me due to the values for HDMI don't actually match the status value of the feature. This quirk is because the command to change to HDMI1 is one thing, and the status reported as HDMI1 is a different number. I could work around that, but just wondering if it normally sync's. I suppose a simple work-around would be to set the default to "_Choose" or something that will be placed first in the list. Then don't react if the user actually chooses that one.
Third, I tried this first as a ff.AddRadioSelectList(Sources), but no buttons displayed at all on the feature so I abandoned that one. Does this work for others?
My code to add the feature starts like this.
Dim ff = FeatureFactory.CreateFeature(pluginId)
Dim Sources As New SortedDictionary(Of String, Double) From {{"TV", 0}, {"HDMI1", 1280}, {"HDMI2", 1281}, {"HDMI3", 1282}, {"HDMI4", 1283}}
ff.OnDevice(parent.Ref)
ff.AddTextDropDown(Sources)
Dim nfd As NewFeatureData = ff.PrepareForHs()
HomeSeerSystem.CreateFeatureForDevice(nfd)
So is this a bug, or am I doing something wrong?
Also wondering if there is a way to display the key that matches the current value of the feature. When closed, the dropdown always displays TV. If this does work for others out there, it is possible that it does not work for me due to the values for HDMI don't actually match the status value of the feature. This quirk is because the command to change to HDMI1 is one thing, and the status reported as HDMI1 is a different number. I could work around that, but just wondering if it normally sync's. I suppose a simple work-around would be to set the default to "_Choose" or something that will be placed first in the list. Then don't react if the user actually chooses that one.
Third, I tried this first as a ff.AddRadioSelectList(Sources), but no buttons displayed at all on the feature so I abandoned that one. Does this work for others?
Comment