Announcement

Collapse
No announcement yet.

Anyone using the HS Device Attention property successfully?

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

  • Anyone using the HS Device Attention property successfully?

    I have a plug-in under development where it might make sense to let the user make a bunch of local changes the HS devices and then bundle them up in one POST to the server to commit them. I don't have to do it this way but it sounded like an interesting idea. So I was looking for a way to tell the user there are pending uncommitted changes and found the Attention property you can set on a device. When set with a string, it puts an icon next to the device and if you hover over it you can see the text you provided. I figured I'd turn this on to indicate unsaved changes and then turn it off when the changes are written.

    Problem is the icon doesn't appear/go away consistently. Seems to require a browser refresh to make the icon appear and disappear after I set or clear the Attention property. Is there something else I need to do to get the brower to update to add/remove the Attention indicator without hitting the refresh button on the browser?

    XM

  • #2
    I've used it in one plugin, that must be around 3-4 years ago now. It's a function that appeared to never really have it's day, there was no new icon that got it bundled with HS so it still has the legacy icons that made a mess of the table formatting IIRC. I asked Rick if it was going to get a place in HSTouch and I think the answer was no - as such I can't really see what function it would have as no one really sits and watches the web UI all of the time. When I used it I did think it worked correctly but really I imagine that you will find you get more people asking what it is and does as it is not that commonly used.

    Comment


    • #3
      Sadly I think you are correct. It doesn't seem very well supported and in the end it probably just makes sense to write changes as the happen vs. batch them up.

      Appreciate the input.

      Comment


      • #4
        I use the function and don't seem to have any issues, except for the mentioned refresh problem

        Code:
        /// <summary>
        /// Set device status image to exclamation in case of error
        /// </summary>
        public string Attention
        {
            get
            {
                if (deviceHS == null) return null;
                return deviceHS.get_Attention(_hs_full_update);
            }
            set
            {
                try
                {
                    if (deviceHS != null)
                        deviceHS.set_Attention(hs, value);
                }
                catch(Exception)
                {
        
                }
            }
        }
        But yeah, nobody watches the HS UI constantly, so may be a better option is to create a separate status device.

        Comment

        Working...
        X