diff --git a/smc/battery.go b/smc/battery.go index 119f112..382dd95 100644 --- a/smc/battery.go +++ b/smc/battery.go @@ -10,7 +10,7 @@ import ( func (c *Connection) GetBatteryCharge() (int, error) { logrus.Tracef("GetBatteryCharge called") - v, err := c.Read(BatteryChargeKeyApple) + v, err := c.Read(BatteryChargeKey) if err != nil { return 0, err } diff --git a/smc/consts.go b/smc/consts.go deleted file mode 100644 index 961dc67..0000000 --- a/smc/consts.go +++ /dev/null @@ -1,12 +0,0 @@ -package smc - -// Various SMC keys. -const ( - MagSafeLedKey = "ACLC" - ACPowerKey = "AC-W" - ChargingKey1 = "CH0B" - ChargingKey2 = "CH0C" - AdapterKey = "CH0I" - BatteryChargeKeyApple = "BUIC" - BatteryChargeKeyIntel = "BBIF" -) diff --git a/smc/consts_amd64.go b/smc/consts_amd64.go new file mode 100644 index 0000000..2835c8a --- /dev/null +++ b/smc/consts_amd64.go @@ -0,0 +1,14 @@ +package smc + +// Various SMC keys for amd64 (Intel 64). +// This file is not used currently because we have no +// plan to support Classic Intel MacBooks. However, +// if we want to, we have something to work on. +const ( + MagSafeLedKey = "ACLC" // Not verified yet. + ACPowerKey = "AC-W" // Not verified yet. + ChargingKey1 = "CH0B" // Not verified yet. + ChargingKey2 = "CH0C" // Not verified yet. + AdapterKey = "CH0K" + BatteryChargeKey = "BBIF" +) diff --git a/smc/consts_arm64.go b/smc/consts_arm64.go new file mode 100644 index 0000000..6439739 --- /dev/null +++ b/smc/consts_arm64.go @@ -0,0 +1,12 @@ +package smc + +// Various SMC keys for arm64 (Apple Silicon) +const ( + MagSafeLedKey = "ACLC" + ACPowerKey = "AC-W" + ChargingKey1 = "CH0B" + ChargingKey2 = "CH0C" + AdapterKey = "CH0I" // CH0K on Intel, if we need it later + BatteryChargeKey = "BUIC" + BatteryChargeKeyIntel = "BBIF" // TODO: separate Intel and Apple keys using go build tags +)