commit 008145f1ce3a5ff0fecd4fbf9fa77217a9be762b
parent 0164aeccb0dd155068362fad3654b054c9a0f3f3
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 22 Feb 2021 17:10:13 +0100
parent 0164aeccb0dd155068362fad3654b054c9a0f3f3
Author: Leah (ctucx) <leah@ctu.cx>
Date: Mon, 22 Feb 2021 17:10:13 +0100
devices/modbusPowermeters: use 3 digits for all values
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/devices/modbusPowermeter.nim b/src/devices/modbusPowermeter.nim @@ -5,12 +5,12 @@ proc updatePowermeter (key: string, device: DeviceConfig) {.async.} = let deviceAddress = device.address.get let currentTimestamp = toUnix(getTime()) - let voltage = (await mb.asyncReadFloat(deviceAddress, 0)).isaRound(2) - let current = (await mb.asyncReadFloat(deviceAddress, 6)).isaRound(2) - let frequency = (await mb.asyncReadFloat(deviceAddress, 70)).isaRound(2) + let voltage = (await mb.asyncReadFloat(deviceAddress, 0)).isaRound(3) + let current = (await mb.asyncReadFloat(deviceAddress, 6)).isaRound(3) + let frequency = (await mb.asyncReadFloat(deviceAddress, 70)).isaRound(3) let `import` = (await mb.asyncReadFloat(deviceAddress, 72)).isaRound(3) let cosphi = (await mb.asyncReadFloat(deviceAddress, 30)).isaRound(3) - let power = (await mb.asyncReadFloat(deviceAddress, 12)).isaRound(2) + let power = (await mb.asyncReadFloat(deviceAddress, 12)).isaRound(3) if server.config.serverConfig.influx.isSome: let config = server.config.serverConfig.influx.get