summaryrefslogtreecommitdiff
path: root/files/common/openwrt/sensors-read.lua
blob: e441b9eadec1556fd4f2e16208294f97b2f68824 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/lua

local sensors = require "sensors"

local config, err = sensors.read_config('/etc/sensors.json')
if not config then error(err) end

local readings, err = sensors.read(config)
if not readings then error(err) end
for name, values in pairs(readings) do
    print(name .. ":")
    for t, v in pairs(values) do
        print(" * " .. t .. " = " .. v)
    end
end