I am building a door sensor using a battery-powered ESP8266.
I have successfully described the thing with two properties; OpenProperty and VoltageProperty.
Is it possible for the VoltageProperty to accept decimals/float?
I read that the WoT Capability Schemas for VoltageProperty is type - number/integer.
Is number/integer the same format?
I am trying to update the VoltageProperty with a float and getting a compile error: no match for ‘operator=’ (operand types are ‘ThingPropertyValue’ and ‘float’)
The issue is that you need to include a multipleOf directive in your property description, e.g. "multipleOf": 0.1. That tells the UI how many decimal places to use. The UI was updated to do that in the 0.9 gateway release, but there is not currently a way to add multipleOf in the webthing-arduino library.
I have changed my property description and it seems to be working OK.
ThingProperty batteryProperty(“Battery Voltage”, “Battery Voltage”, NUMBER, “multipleOf: 0.1”);