NorthernMan54 / homebridge-mcuiot

Homebridge platform plugin that support's a network of nodemcu's running nodemcu-dht-yl69-mdns to display Temperature and Humidity.
30 stars 12 forks source link

[Question] Digits after the comma #13

Closed chimcen closed 5 years ago

chimcen commented 5 years ago

Hi,

is there a way to shorten the measurement values to only one digit after the comma instead of actual two?

NorthernMan54 commented 5 years ago

Are you referring to the json response object from the nodemcu device? Yes it should be feasible to change the number of digits in the response object, the lua code on the device would need to be modified to change the precision of the response object.

In the file main.lua you can see the calls to read the device, and generate the json message.

When I wrote that I didn’t change the precision returned by the sensor as I wanted it to leave it the the code plugin code to change adjust as needed.

On Sep 17, 2018, at 7:06 PM, chimcen notifications@github.com wrote:

Hi,

is there a way to shorten the measurement values to only one digit after the comma instead of actual two?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

chimcen commented 5 years ago

How could this be done? Sry, no idea about that...