hektiker1983 / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

Colours in labels and status texts #317

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The openHAB UI should provide the ability to configure the colour of label and 
state texts. 

This should be possible for all items, including switches and other items where 
the state is displayed as a text by using a mapping. It should be possible to 
set the colour in mappings, so that different colours for different states 
could be used.

In short: All place where a text is accepted should also provide the 
possibility to configure the colour of the text or of parts of it. 

This could be used for better structuring the interface or for improving the 
readability of state texts. 

Original issue reported on code.google.com by estan...@gmx.de on 26 May 2013 at 10:11

GoogleCodeExporter commented 8 years ago
Myself and Mihail have been discussing this offline and have the following 
proposal that we will try and test. The idea is to support both colours, and 
different icons for status. Currently OH only supports different icons on a 
very static basis (ie based on the state, and -ON, or -OFF, or percent etc). 
The idea is to support a more flexible icon definition where you can specify 
the icons and colours in the sitemap rather than relying on these static 
definitions.

So, the following is proposed -:

Icon gets an upgrade to support different icons for different values. We 
continue to support the existing icon="iconname.png" format so we don't loose 
any backward compatibility. We also support the following "array" style 
definition -:

icon="10=icon1, 20=icon2, Uninitialized=icon3"

Additionally, we add three new attributes to allow the three components of an 
item (icon, label and value) to set their colours. These are 
labelcolor/iconcolor/valuecolor and they have the following format -:
labelcolor="green" (to set a static color)
labelcolor="10=green,20=blue,30=red" (to set range based colors)

With the above, you can statically set a colour (maybe for a Frame label), or 
you can dynamically adjust a colour (say, for a battery voltage or temperature 
reading). This should provide full customisation of the display with minimal 
impact on existing implementations.

On the REST side, the current icon/label tags remains untouched and we just add 
the three new color tags (labelcolor/iconcolor/valuecolor). In theory existing 
implementations should just ignore these tags until support is added, so again, 
it should be backward compatible.

Any comments are welcome otherwise I'll try and prototype this in the coming 
days.

Original comment by ch...@cd-jackson.com on 17 Oct 2013 at 1:11

GoogleCodeExporter commented 8 years ago
This sounds very good for me!

Original comment by estan...@gmx.de on 19 Oct 2013 at 1:17

GoogleCodeExporter commented 8 years ago
See https://groups.google.com/forum/#!topic/openhab/uMBrYWi-eeI

Original comment by ch...@cd-jackson.com on 22 Oct 2013 at 1:40

GoogleCodeExporter commented 8 years ago
Implemented with https://github.com/openhab/openhab/pull/57

Original comment by kai.openhab on 5 Dec 2013 at 10:13