thermal: function argument is already local

This commit is contained in:
Adrian C. (anrxc) 2010-03-15 17:54:00 +01:00
parent 4f86e28ec3
commit f50ad217ea
1 changed files with 3 additions and 2 deletions

View File

@ -25,10 +25,11 @@ local function worker(format, warg)
["core"] = {"/sys/devices/platform/", file = "temp1_input",div = 1000}, ["core"] = {"/sys/devices/platform/", file = "temp1_input",div = 1000},
["proc"] = {"/proc/acpi/thermal_zone/",file = "temperature"} ["proc"] = {"/proc/acpi/thermal_zone/",file = "temperature"}
} -- Default to /sys/class/thermal } -- Default to /sys/class/thermal
local warg = type(warg) == "table" and warg or {warg, "sys"} warg = type(warg) == "table" and warg or { warg, "sys" }
local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1])
-- Get temperature from thermal zone -- Get temperature from thermal zone
local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1])
if thermal[zone[warg[2]].file] then if thermal[zone[warg[2]].file] then
if zone[warg[2]].div then if zone[warg[2]].div then
return {thermal[zone[warg[2]].file] / zone[warg[2]].div} return {thermal[zone[warg[2]].file] / zone[warg[2]].div}