package io.github.pandalxb.test;import io.github.pandalxb.jsensors.JSensors;import io.github.pandalxb.jsensors.model.components.Components;import io.github.pandalxb.jsensors.model.components.Cpu;import io.github.pandalxb.jsensors.model.components.Disk;import io.github.pandalxb.jsensors.model.sensors.Temperature;import java.util.List;
public class JSensorsTest {
public static void main(String[] args){
Components components = JSensors.get.components();
List<Cpu> cpus = components.cpus;if(cpus != null){for(final Cpu cpu : cpus){
System.out.println("Found CPU component: " + cpu.name);if(cpu.sensors != null){
System.out.println("Sensors: ");
//Print temperatures
List<Temperature> temps = cpu.sensors.temperatures;for(final Temperature temp : temps){
System.out.println(temp.name + ": " + temp.value + " C");}}}}
List<Disk> disks = components.disks;if(disks != null){for(final Disk disk : disks){
System.out.println("Found Disk component: " + disk.name);if(disk.sensors != null){
System.out.println("Sensors: ");
//Print temperatures
List<Temperature> temps = disk.sensors.temperatures;for(final Temperature temp : temps){
System.out.println(temp.name + ": " + temp.value + " C");}}}}}}
Found CPU component: Intel Core i5-4590
Sensors:
Temp Core Max: 51.0 C
Temp Core Average: 50.0 C
Temp CPU Core #1: 50.0 C
Temp CPU Core #2: 51.0 C
Temp CPU Core #3: 51.0 C
Temp CPU Core #4: 48.0 C
Temp CPU Package: 51.0 C
Temp CPU Core #1 Distance to TjMax: 50.0 C
Temp CPU Core #2 Distance to TjMax: 49.0 C
Temp CPU Core #3 Distance to TjMax: 49.0 C
Temp CPU Core #4 Distance to TjMax: 52.0 C
Found Disk component: SanDisk SSD PLUS 120GB
Sensors:
Temp Temperature: 26.0 C
Found Disk component: WDC WD10EZEX-08WN4A0
Sensors:
Temp Temperature: 29.0 C