Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 8.1 - Can't return anything with SMCKit #28

Closed
PKBeam opened this issue Nov 25, 2016 · 2 comments
Closed

Xcode 8.1 - Can't return anything with SMCKit #28

PKBeam opened this issue Nov 25, 2016 · 2 comments

Comments

@PKBeam
Copy link

PKBeam commented Nov 25, 2016

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
Copy link
Owner

beltex commented Nov 25, 2016

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
Copy link
Author

PKBeam commented Nov 25, 2016

Ah, I see. Thanks.

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

No branches or pull requests

2 participants