-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add BatteryStatus #4172
Comments
I guess? PR welcome. macOS note: IOKit.framework should be loaded dynamically with dlopen, not linked against with |
I can work on the macOS part :) |
I can work on the linux for arm64, as well but I need a bit more time for it :) |
I can work on Windows implementation soon @juanarbol To ensure we're aligned, could you specify the features you're working on? I've seen your PR and I'll use it to start my branch. Specifically, are you planning to implement the https://developer.mozilla.org/en-US/docs/Web/API/BatteryManager ? |
Yes, once we have everything landed in libuv, I can implement the battery thing in Node.js |
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Are we sure about Linux? I tried reading from the
|
aras@aras-Lenovo-Legion-5-17ARH05H:~$ cat /sys/class/power_supply/BAT0/capacity
100
|
That works on laptops; for servers, it is empty; the same happens with macOS, I will propose returning a |
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Refs: libuv#4172 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Well. How about providing the battery status, as described in mdn for navigator.getBattery()
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getBattery
Win:
https://learn.microsoft.com/en-us/windows/win32/power/battery-information
Mac:
https://developer.apple.com/documentation/iokit/iopowersources_h#topics
Linux:
Read the status from /sys/class/power_supply/
The text was updated successfully, but these errors were encountered: