Expanded text attributes for uiValue

Posted on
Sat Nov 25, 2017 2:56 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Expanded text attributes for uiValue

For custom plugin devices: Allow additional attributes for the updateStateOnServer() uiValue. Presently the uiValue is rendered as simple black text. The only available option is to use setErrorStateOnServer() which renders all text, not just the uiValue text, for the device in red.

When setting the uiValue to be displayed as a custom device/s state, I would like to have an option to set the color value, and possibly a style for the uiValue text. This might be limited to a small set of predefined colors, or ;possibly an arbitrary RGB value. Style options might be bold or italic.

For example:
Code: Select all
dev.updateStateOnServer(key='displayState', value="foobar", uiValue="foobar", uiValColor="orange", uiValStyle="bold)
or...
dev.updateStateOnServer(key='displayState', value="foobar", uiValue="foobar", uiValColor="ff9900", uiValStyle="italic)
And, for the benefit of the imagination impaired :D
    foobar vs foobar vs foobar

Posted on
Sat Nov 25, 2017 3:12 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Expanded text attributes for uiValue

One issue is that the state text has to be rendered in different visual contexts (Mac UI, Web browser UI, Indigo Touch UI; both light and dark themes, etc.), so some colors may not render well in some visual contexts. So I think if we did something like this it would be more of a style specifier, like uiValueStyle with possible values like: normal, important, notify, caution, error, etc.

Image

Posted on
Sat Nov 25, 2017 3:17 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Expanded text attributes for uiValue

matt (support) wrote:
...I think if we did something like this it would be more of a style specifier, like uiValueStyle with possible values like: normal, important, notify, caution, error, etc.

Sure... well, as long as I got to make some suggestions :wink:

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests