Xcode 8.1 - Can't return anything with SMCKit
PKBeam opened this issue · 2 comments
PKBeam commented
Running this code (on MacBookPro13,2 with 10.12.1):
import Cocoa
import SMCKit
do {
let fans = try SMCKit.fanCount()
print(fans)
} catch {
print("Error")
}
Prints "Error". It happens with fan speed, fan names, etc. What am I doing wrong?
beltex commented
Hello @PKBeam!
open()
must be called first to get a connection to the SMC driver (and make sure to call close()
when your done!). See SMCKitTool for an example. README
/docs should be updated to make that clear, since a number of folks have asked about this, (so my bad!).
Hope that helps!
P.S New Macbook? Nice! :)
PKBeam commented
Ah, I see. Thanks.