sebhildebrandt / osx-temperature-sensor

OSX temperature sensor
MIT License
19 stars 7 forks source link

Apple Silicon M2 Support #13

Open shamoon opened 1 year ago

shamoon commented 1 year ago

Thank you for taking the time to create this project (and the amazing si).

On my M2 Pro MacBookPro the values returned seem inaccurate:

{
  main: 5.459799861907959,
  cores: [
    4.632999897003174,
    4.632999897003174,
    6.699999809265137,
    4.632999897003174,
    6.699999809265137
  ],
  max: 6.699999809265137
}

when compared to e.g. some of the tools out there:

Screenshot 2023-03-31 at 11 08 18 AM Screenshot 2023-03-31 at 11 41 16 AM Screenshot 2023-03-31 at 11 29 04 AM

I realize this is not such an easy thing to sort out especially if you don't have m2 hardware to test with but of course I can help with that. I tried fiddling a bit using sensor keys that I found on the web, in particular https://github.com/exelban/stats/blob/master/Modules/Sensors/values.swift ( https://github.com/exelban/stats/issues/1012 ) without much luck, not sure if the M2 Pro even has different keys than just M2.

Here's the full output of smc list: https://gist.github.com/shamoon/c973409ceb51b8f73750f55a2db56891

Again happy to help figure this out in any way I can but I admit I think I'd need a little guidance. There would also be the task of detecting this beyond process.arch == 'arm64'

Thanks for considering and either way for the awesome projects.