Announcement

Collapse
No announcement yet.

How to get the Label for a StatusControl Value?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to get the Label for a StatusControl Value?

    If I have a virtual device that uses 1 ("Home"), 2 ("Away"), or 3 ("Vacation"), and I get a value change event that tells me it changed to 2, how do I interrogate the device's configuration to find out the label that goes with that value?

    Or, asked another way, what's the HS4 equivalent of "DeviceVSP_GetStatus"?

    #2
    Hi, did you ever figure this out? Thanks!
    stefxx

    Comment


      #3
      Isn't this just the Label property of the StatusControl? If your context is not a specific StatusControl then it would be with iteration through StatusControlCollection.

      Click image for larger version

Name:	Capture.PNG
Views:	70
Size:	199.0 KB
ID:	1365302

      Comment


        #4
        Thanks! I managed to get the current label like this:

        Dim dvf As HsFeature = <whatever>
        dvf.StatusControls.Values(dvf.Value()).Label
        stefxx

        Comment

        Working...
        X