From f50ad217ea8db1f21ef6561ec01e4bae387273e5 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Mon, 15 Mar 2010 17:54:00 +0100 Subject: thermal: function argument is already local --- widgets/thermal.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'widgets/thermal.lua') diff --git a/widgets/thermal.lua b/widgets/thermal.lua index 6ba8c69..4d837c8 100644 --- a/widgets/thermal.lua +++ b/widgets/thermal.lua @@ -25,10 +25,11 @@ local function worker(format, warg) ["core"] = {"/sys/devices/platform/", file = "temp1_input",div = 1000}, ["proc"] = {"/proc/acpi/thermal_zone/",file = "temperature"} } -- Default to /sys/class/thermal - local warg = type(warg) == "table" and warg or {warg, "sys"} - local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) + warg = type(warg) == "table" and warg or { warg, "sys" } -- Get temperature from thermal zone + local thermal = helpers.pathtotable(zone[warg[2]][1] .. warg[1]) + if thermal[zone[warg[2]].file] then if zone[warg[2]].div then return {thermal[zone[warg[2]].file] / zone[warg[2]].div} -- cgit v1.2.3