openhab-core/itests/org.openhab.core.tests/src/main
lolodomo 1fb949ba8f
Set a default presentation pattern for String/Number/Datetime items (#4175)
* Set a default presentation pattern for String/Number/Datetime items

A default state pattern was previously provided by ChannelStateDescriptionProvider only for String and Number items linked to a channel.
It is now the class DefaultStateDescriptionFragmentProvider which is responsible for providing the default state pattern for items, whether the item is linked to a channel or not.
This new class is the lowest ranked StateDescriptionFragmentProvider so that all other providers have priority in setting the state pattern.

Default pattern for string item: %s
Default pattern for datetime item or group with datetime state: %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS
Default pattern for number item or group with number state: %.0f
Default pattern for number+dimension item or group with number+dimension state: %.0f %unit%

Closes #4071
Closes #3835

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2024-05-02 16:29:35 +02:00
..
java/org/openhab/core Set a default presentation pattern for String/Number/Datetime items (#4175) 2024-05-02 16:29:35 +02:00
resources/OH-INF/i18n Added unit test for UTF-8 encoded properties (#2295) 2021-04-19 17:07:47 +02:00