Announcement

Collapse
No announcement yet.

Seeting HS device value (SetIOMulti)

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

    Seeting HS device value (SetIOMulti)

    Setting HS device value (SetIOMulti)

    In HS3 if you control HS device from HS (i.e from deviceutility page) i HS notifies the plugin which owns the device, but doesn't update the device value in HS. It's plugins responcibility to handle the request and update the HS device value when plugin is happy. Which makes sense.

    But in HS4 I control the HS device - and the device value changes immidiately.

    What's changed here?

    #2
    But in HS4 I control the HS device - and the device value changes immidiately.
    I don't think that's true. For me it works just like in HS3.
    Only virtual devices (=devices not own by any plugin) behave like this

    Comment


      #3
      Originally posted by spud View Post

      I don't think that's true. For me it works just like in HS3.
      Only virtual devices (=devices not own by any plugin) behave like this
      Then I must be doing something wrong...

      What's the definition of "Virtual" device then? If "Interface" property is empty?

      Comment


        #4
        Originally posted by spud View Post

        I don't think that's true. For me it works just like in HS3.
        Only virtual devices (=devices not own by any plugin) behave like this
        If you create a sample switch device in your HomeSeerSamplePlugin - it behaves as I described. And I can't see any source code handling SetIOMulti.

        I may be wrong spud

        Comment


          #5
          Originally posted by alexbk66 View Post

          If you create a sample switch device in your HomeSeerSamplePlugin - it behaves as I described. And I can't see any source code handling SetIOMulti.

          I may be wrong spud

          This is because the default behavior in AbstractPlugin.SetIOMulti is to set the device value. So, if the plugin does not override SetIOMulti, then yes it behaves as you describe.

          Code:
           /// <inheritdoc cref="IPlugin.SetIOMulti" />
          /// <remarks>
          /// The default behavior is to clear the current status text and set the value on the target feature and then
          /// let HomeSeer assign the status text based on the configured <see cref="StatusControl"/>s
          /// and <see cref="StatusGraphic"/>s
          /// </remarks>
          public virtual void SetIOMulti(List<ControlEvent> colSend) {
          foreach (var controlEvent in colSend) {
          HomeSeerSystem.UpdateFeatureValueByRef(controlEvent.TargetRe f, controlEvent.ControlValue);
          }
          }

          Comment


            #6
            Thank you, that's what I suspected

            Comment

            Working...
            X