-
Notifications
You must be signed in to change notification settings - Fork 594
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
hs.brightness.ambient()
is returning "-1" (an error)
#1970
Comments
I wonder if newer MacBooks have a different underlying piece of hardware for getting ambient data. We use the IOKit service |
@cmsj - Is this relevant? |
@cmsj, I think you're right. I just did a little googling and found this post on the Apple Developer Forum which is pretty strong confirmation. It seems that there isn't any public API for getting data from this sensor on macOS (even the current API that HS is using isn't public actually). I wonder if there are private APIs for this that someone has stumbled on. I haven't looked through the code, but there's a Dynamic Dark Mode app on GitHub that seems to be using the sensor (though maybe they are just querying screen brightness). I found it while working on a Spoon that provides the same functionality, which is how I came across this issue in the first place. |
I saw this - https://github.com/insidegui/DarkModeBuddy not sure if it's relevant.. |
that seems very relevant, I think we can make that work. It's private API, so might break at any time, but it's not like the old ambient sensor code was particularly public/supported. |
Today I tried using
hs.brightness.ambient()
, but I wasn't able to get in to return anything other than “-1”.I have a 2017 13-inch MacBook Pro with Touch Bar running macOS Mojave (10.14.0) and it's not connected to an external display. I chatted with @matthewfallshaw who has a 2018 15-inch MacBook Pro running Mojave, and he's also experiencing the same issue, so it seems unlikely that my sensor is on the fritz or that it's a software issue unique to my machine.
The text was updated successfully, but these errors were encountered: