mirror of
https://github.com//inv2004/sensors
synced 2026-01-15 13:31:44 +00:00
No description
| examples | ||
| src | ||
| tests | ||
| README.md | ||
| sensors.nimble | ||
sensors
libsensors wrapper
- dynamic load and check of libsensors.so
Example
https://github.com/inv2004/sensors/blob/main/examples/dump.nim
import sensors
import strformat
init()
for chip in chips():
echo fmt"{chip.name}: {chip.prefix}"
for feature in chip:
echo fmt" {feature.label} ({feature.kind})"
for subfeature in feature:
echo fmt" {subfeature.name}: {subfeature.value} ({subfeature.kind})"
coretemp-isa-0000: coretemp
Package id 0: 40.0
Core 0: 39.0
Core 1: 40.0
thinkpad-isa-0000: thinkpad
CPU: 34.0
GPU: 0.0
temp3: 0.0
temp4: 0.0
temp5: 0.0
temp6: 0.0
temp7: 0.0
temp8: 0.0
nvme-pci-0500: nvme
Composite: 23.85
BAT0-acpi-0: BAT0
iwlwifi_1-virtual-0: iwlwifi_1
temp1: 28.0
pch_skylake-virtual-0: pch_skylake
temp1: 33.0
BAT1-acpi-0: BAT1
acpitz-acpi-0: acpitz
temp1: 34.0
Helpers example
import sensors
init()
echo cpuTemp()
echo ssdTemp()