calaos / calaos_base

Calaos server
https://calaos.fr
GNU General Public License v3.0
160 stars 37 forks source link

problem using xml in weboi #88

Closed azertybepo closed 9 years ago

azertybepo commented 9 years ago

in weboi -> analog input url :http://api.openweathermap.org/data/2.5/weather?q=paris&lang=fr&mode=xml path:current/temperature/@value offset: 273

DBG<12393>:calaos_input IO/InputAnalog.cpp:125 virtual double Calaos::InputAnalog::get_value_double()() input_44: 1 * 1.58738e-314 + 273

value displayed is 273 which is the offset obviously maybe 'im not using xpath correctly

<current><city id="2661035" name="paris"><coord lon="11" lat="19"/><country>France</country><sun rise="2014-11-19T06:41:58" set="2014-11-19T15:50:31"/></city><temperature value="282.66" min="282.15" max="283.15" unit="kelvin"/><humidity value="81" unit="%"/><pressure value="1020" unit="hPa"/><wind><speed value="1" name="Calm"/><direction value="0" code="N" name="North"/></wind><clouds value="75" name="broken clouds"/><visibility/><precipitation mode="no"/><weather number="803" value="nuageux" icon="04d"/><lastupdate value="2014-11-19T10:50:00"/></current>
raoulh commented 9 years ago

Fixed in https://github.com/calaos/calaos_base/commit/49ef15c7d1125badfd9fe6ef13a67e65c73387d5

Also the correct path should start with / as root. ex: /current/temperature/@value