[ANSWERED]: Which kStateImageSel Icon to Use?

Posted on
Sat Apr 02, 2016 5:20 am
DaveL17 offline
User avatar
Posts: 6784
Joined: Aug 20, 2013
Location: Chicago, IL, USA

[ANSWERED]: Which kStateImageSel Icon to Use?

Something I've been wrestling with is how to present icons in the UI with respect to "on" or "off". That is, I had originally taken to the method of showing an on state icon to convey that a plugin feature was working properly and online (for example, a thermometer ON icon in WUnderground.) However, in the broader Indigo context, this isn't consistent with how other devices are presented--i.e., my Aeon Multisensors don't display a thermometer ON icon, but rather a thermometer OFF icon. Now I'm of the mindset that I want to be more consistent with the "world around me." I can't make up my mind as there seems to be pros and cons to both approaches.

I'd be curious to hear of others' druthers.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Wed Apr 06, 2016 9:14 am
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: Which kStateImageSel Icon to Use?

Great question. The general philosophy we follow is to only show ON variants for devices that need to represent some type of ON/OFF state to the user. The obvious cases are ON/OFF relays (and sensors) and dimmer modules/bulbs. Less obvious would be how we show furnace and compressor equipment OFF/ON states when showing a thermostat device.

But for, say, just a temperature sensor that has a numerical value we always show those as just a gray thermometer icon. We don't currently do this, but I could see using the ON (colored) thermometer icon if it was a temperature sensor that also had some out-of-bounds reporting (like freezing).

The idea behind all this is to reserve the color versions of the icons for instances where you want to draw the users attention to that device in order to indicate that it is ON, tripped, opened, etc. A sensor device reporting just a temperature value wouldn't qualify for that.

As for reporting error cases, if you aren't already then you should set the error state for the devices if that particular device isn't working (couldn't be updated because of a failed request, etc.) via something like:

Code: Select all
dev.setErrorStateOnServer(u"request failed")

That will show the device in red in the UI which is what we do for most (but not all yet) of Indigo's device to indicate something isn't working right. Internally we probably don't call that method enough, so some of our plugins/devices may not reflect the desired behavior of showing red in all cases where something failed for that device.

In summary:

  • normal/off (grayscale) icon: indicates device is working correctly and is in the OFF/closed/etc state if it has states.
  • on (colored) icon: indicates device/sensor is in the ON/opened/tripped/etc. state.
  • error state (icon will be shown invisible or disable and device name text in red): something isn't working with device or plugin is disabled/not started yet.
  • disabled state (icon and device name rendered using disable appearance): when a device has communication disabled (all my holiday lights modules are in this state, for example, since it isn't the season).

Image

Posted on
Wed Apr 06, 2016 9:57 am
DaveL17 offline
User avatar
Posts: 6784
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: [ANSWERED]: Which kStateImageSel Icon to Use?

I have my moments. :D

Thanks for the detailed response Matt. I'll work to bring my plugins into "compliance" with this approach as I roll out updates. I don't presently use dev.setErrorStateOnServer() but definitely can see the advantages of using that over my current approach. I need to think through how to address various scenarios--i.e, how and whether to distinguish between a "normal" error state (can't communicate with an external server) vs. some kind of fatal error, but I think that maybe this can be handled with the string of the error state method you mentioned combined with various log messages.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests