mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
feat: added spa5 type to the SMC and a few new power sensors (#2161)
This commit is contained in:
@@ -20,6 +20,7 @@ internal enum SMCDataType: String {
|
||||
case SP3C = "sp3c"
|
||||
case SP4B = "sp5b"
|
||||
case SP5A = "sp5a"
|
||||
case SPA5 = "spa5"
|
||||
case SP69 = "sp669"
|
||||
case SP78 = "sp78"
|
||||
case SP87 = "sp87"
|
||||
@@ -239,6 +240,9 @@ public class SMC {
|
||||
case SMCDataType.SP96.rawValue:
|
||||
let intValue: Double = Double(Int(val.bytes[0]) * 256 + Int(val.bytes[1]))
|
||||
return Double(intValue / 64)
|
||||
case SMCDataType.SPA5.rawValue:
|
||||
let result: Double = Double(UInt16(val.bytes[0]) * 256 + UInt16(val.bytes[1]))
|
||||
return Double(result / 32)
|
||||
case SMCDataType.SPB4.rawValue:
|
||||
let intValue: Double = Double(Int(val.bytes[0]) * 256 + Int(val.bytes[1]))
|
||||
return Double(intValue / 16)
|
||||
|
||||
Reference in New Issue
Block a user