sky201503 / openhab

Automatically exported from code.google.com/p/openhab
GNU General Public License v3.0
0 stars 0 forks source link

HABDroid/GreenT not displaying '$' in item strings properly #343

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add an item with a display containing the '$' character (e.g. "Daily Total 
[\\$%.2f]"). Note the \\ to escape the $ character out.
2. Open the GreenT or HABDroid interface. 

What is the expected output? What do you see instead?

Expect to see;
"Daily Total           $12.34"

Actually see;
"Daily Total           \$12.34"

What version of the product are you using? On what operating system?

Latest snapshot (1.3.0). openHAB running on Ubuntu. 

Please provide any additional information below.

Original issue reported on code.google.com by ben.jone...@gmail.com on 16 Jun 2013 at 1:28

GoogleCodeExporter commented 8 years ago

Original comment by kai.openhab on 13 Aug 2013 at 10:11

GoogleCodeExporter commented 8 years ago
Kai, this is how REST returns this value:

<widget>
 <widgetId>demo_1_0</widgetId>
 <type>Text</type>
 <label>Outside Temperature [\$17.00]</label>
 <icon>temperature</icon>
 <item>
  <type>NumberItem</type>
  <name>Weather_Temperature</name>
  <state>17</state>
  <link>http://localhost:8080/rest/items/Weather_Temperature</link>
 </item>
 <linkedPage>
  <id>0100</id>
  <title>Outside Temperature [\$17.00]</title>
  <icon>temperature</icon>
  <link>http://localhost:8080/rest/sitemaps/demo/0100</link>
 </linkedPage>
</widget>

There are no exact guidelines in REST API docs on how to interpret values, so 
HABDroid is just showing the value from REST API response. How should it be? 
:-) Why should we escape $ in XML text field??

Original comment by belovic...@gmail.com on 13 Aug 2013 at 5:55

GoogleCodeExporter commented 8 years ago

Original comment by teichsta on 13 Aug 2013 at 7:42

GoogleCodeExporter commented 8 years ago
Fixed with changeset 
https://code.google.com/p/openhab/source/detail?r=5be16c4ed9d85ddc1d0b03971115f8
46874d565e

Please note that you do NOT need the \\ anymore - you can simply type "Daily 
Total [$%.2f]".

Original comment by kai.openhab on 13 Aug 2013 at 9:11