Skip to content

feat: support M5#46

Merged
narugit merged 4 commits into
narugit:mainfrom
ryo-touch:feat/support_m5
Apr 22, 2026
Merged

feat: support M5#46
narugit merged 4 commits into
narugit:mainfrom
ryo-touch:feat/support_m5

Conversation

@ryo-touch

Copy link
Copy Markdown
Contributor

Summary

Add Apple M5 support so that smctemp -c / smctemp -g returns valid temperatures on M5 Macs. Without this change, M5 Macs fall through getCPUModel() and always return 0.0.

SMC sensor keys for M5 are taken from exelban/stats Platform.m5Gen and verified against a real M5 MacBook Air (Mac17,3, macOS 26.3.2) via smctemp -l.

Verification

Tested on Apple M5 MacBook Air (Mac17,3, macOS 26.3.2):

  • smctemp -c returns ~35℃ at idle, ~46℃ under yes > /dev/null load
  • smctemp -g returns ~35℃ at idle, ~40℃ under CPU load
  • Builds cleanly with make (no new warnings)

Sensor keys added

  • CPU: Tp00, Tp04, Tp08, Tp0C, Tp0G, Tp0K (super cores), Tp0O, Tp0R, Tp0U, Tp0X, Tp0a, Tp0d, Tp0g, Tp0j, Tp0m, Tp0p, Tp0u, Tp0y (performance cores)
  • GPU: Tg0U, Tg0X, Tg0d, Tg0g, Tg0j, Tg1Y, Tg1c, Tg1g

Some keys are absent on base M5 silicon, but CalculateAverageTemperature filters out-of-range (10-120℃) readings automatically, so no extra logic is needed.

@ryo-touch

Copy link
Copy Markdown
Contributor Author

@narugit Thanks for the great OSS! I've opened this PR to add Apple M5 support — would really appreciate your review when you have time.

M5 対応の PR を出してみたので、お時間あるときにレビューいただけるとうれしいです。よろしくお願いします。

@narugit narugit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応ありがとうございます!
細かいですが下記対応をお願いいたします。

Comment thread smctemp.cc Outdated
Comment thread smctemp.cc Outdated
ryo-touch and others added 2 commits April 22, 2026 09:37
Co-authored-by: narugit <narusens@gmail.com>
Co-authored-by: narugit <narusens@gmail.com>
@ryo-touch

ryo-touch commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@narugit レビューありがとうございます!suggest changesをリンク先確認したうえでコミットさせていただきました!

@ryo-touch ryo-touch requested a review from narugit April 22, 2026 00:38

@narugit narugit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

対応ありがとうございます

@narugit narugit merged commit 9b04c62 into narugit:main Apr 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants