Closed GoogleCodeExporter closed 9 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
This sounds very good for me!
Original comment by estan...@gmx.de
on 19 Oct 2013 at 1:17
See https://groups.google.com/forum/#!topic/openhab/uMBrYWi-eeI
Original comment by ch...@cd-jackson.com
on 22 Oct 2013 at 1:40
Implemented with https://github.com/openhab/openhab/pull/57
Original comment by kai.openhab
on 5 Dec 2013 at 10:13
Original issue reported on code.google.com by
estan...@gmx.de
on 26 May 2013 at 10:11