From 8cc661923b04e098d709ccad967895de08c3d2d6 Mon Sep 17 00:00:00 2001 From: HuangRui Date: Sat, 31 Jan 2015 10:46:43 +0800 Subject: [PATCH] The read function returns an incorrect temperature. Fixed #149. --- lua_modules/ds18b20/ds18b20.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua_modules/ds18b20/ds18b20.lua b/lua_modules/ds18b20/ds18b20.lua index bc1b1c99..dba2ee46 100644 --- a/lua_modules/ds18b20/ds18b20.lua +++ b/lua_modules/ds18b20/ds18b20.lua @@ -126,7 +126,7 @@ function read(addr, unit) if((t1 == nil ) or (t2 ==nil)) then return nil else - return t1.."."..t2 + return t1.."."..string.format("%04u", t2) end end