We have moved at community.getvera.com

Author Topic: Is there something wrong with the number parser for Luup variables/events?  (Read 2176 times)

Offline Ap15e

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 1998
  • Karma: +12/-0
While implementing Luup events for local dose rates (see http://forum.micasaverde.com/index.php?topic=5466.0), I came across a strange phenomenon:

UPnP variable DoseRateCosmical is defined as dataType number.

Scene has event 'Cosmical dose rate goes above' [0.1] 'microSv/h'.

Hook for DoseRateCosmical seems to be OK.

Setting DoseRateCosmical to 0.9 doesn't trigger the event.

Setting DoseRateCosmical to 1.1 does trigger the event ...

According to http://forum.micasaverde.com/index.php?topic=5988.msg35515#msg35515 number is a 8 byte float.

How to reproduce:

Code: [Select]
luup.variable_set( "urn:upnp-ap15e-com:serviceId:DAD1", 'DoseRateCosmical'    , '1.99', DAD_ID )
does trigger the event, whereas
Code: [Select]
luup.variable_set( "urn:upnp-ap15e-com:serviceId:DAD1", 'DoseRateCosmical'    , '0.99', DAD_ID )
doesn't trigger the event.

« Last Edit: March 20, 2011, 02:34:13 pm by Ap15e »