igorgladkov / rotini

Project Rotini (alpha)
44 stars 0 forks source link

Text widget does not updated automatically when DateTime item is used as source #172

Open dummylabs opened 8 years ago

dummylabs commented 8 years ago

I have two items in my openhab2 config:

DateTime string1 "[%1$tH:%1$tM:%1$tS]"
String   string2

and two text widgets as follows:

Frame label="datetime item {widget:text}" {
  Text item=string1 label="x"
}

Frame label="string item {widget:text}" {
  Text item=string2 label="y"
}

If I try to update both items' state via REST API:

curl --header "Content-Type: text/plain" --request PUT --data "2016-08-13T20:07:02.650+0300"  http://192.168.1.150:8080/rest/items/test1/state

curl --header "Content-Type: text/plain" --request PUT --data "text1"  http://192.168.1.150:8080/rest/items/test2/state

Result: Then text widget for string1 always updates immediately. Text widget for string2 either not updated at all, or updates to its previous value (before last update).

Expected: string2 updated to actual value as fast as string1 usually updated

Additional notes:

igorgladkov commented 8 years ago

Item value formatting (e.g. [%1$tH:%1$tM:%1$tS]) creates this bug and therefore might not be supported in the future. Removing value formatting would not make sense in this case, since date will not be formatted properly, so there is no known workaround at this point.