Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 763 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 763 Bytes

lua-OpenHardwareMonitor

License

Access to OpenHardwareMonitor WMI interface

Usage

local monitor = OpenHardwareMonitor.new()

-- Connect to OpenHardwareMonitor MWI source
monitor:open()

-- get all information as 2 arrays
local hardware, sensors = monitor:fetchAll()

-- get information as tree (similar as in GUI)
local tree = monitor:buildTree()

-- select specific sensors/hardware by names
local rs = monitor:select{
  {'/intelcpu/0', 'Temperature'};
  {'/intelcpu/0', 'Voltage'};
}

local Temperatures = rs[1]
if Temperatures then
  for _, v in ipairs(Temperatures) do
    print(v.name, v.value)
  end
end