shirou / gopsutil

psutil for golang
Other
10.28k stars 1.56k forks source link

fix: read temperature sensors darwin arm #1672

Open Girbons opened 6 days ago

Girbons commented 6 days ago

Description

proposal to read temperature sensors for mac with apple silicon

fixes #1332

Tested with M1

image
shirou commented 4 days ago

Thank you for your contribution! At first glance, it looks good. However, I don't have an environment to test it, so could someone else please verify its functionality?

And also, sensors/darwin_arm_sensors.h is copied from other project. It is BSD-3 clause license, so it is not a problem, but could you add those two lines on head of the file in order to make it machine readable?

// SPDX-FileCopyrightText: Copyright (c) 2016-2018, "freedom" Koan-Sin Tan
// SPDX-License-Identifier: BSD-3-Clause
Girbons commented 4 days ago

And also, sensors/darwin_arm_sensors.h is copied from other project. It is BSD-3 clause license, so it is not a problem, but could you add those two lines on head of the file in order to make it machine readable?

Sure!

davidnewhall commented 1 day ago

Can confirm adding this line to go.mod (and running go mod tidy) gives me temperates on an M2 Mac mini that I did not have before.

replace github.com/shirou/gopsutil/v4 => github.com/Girbons/gopsutil/v4 ba82fef

Screenshot 2024-07-10 at 3 14 10 PM