You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed onNativeBatteryLevelEvent only returns battery level. However, upon reviewing the code, it appears that additional information such as charging status, full lifetime of battery in seconds, remaining battery life in seconds and power line status can be retrieved too. More detailed widgets can be created with these.
A new event called onNativeBatteryEvent can return a JSON like this.
(onNativeBatteryLevelEvent can be renamed to onNativeBatteryEvent too.)
It would be great if you could create a PR! I currently don't have a windows laptop which I can use to test the battery feature.
Doing this would break existing user widgets, but since there's no automatic updates; I think it's ok. I can add a warning to the patch notes that widgets relying on this feature will need to be tweaked.
beyenilmez
added a commit
to beyenilmez/WinWidgets
that referenced
this issue
Dec 14, 2023
* modified onNativeBatteryLevelEvent
* updated template battery widget to show charging status and remaining time
* updated the index.html to show the usage of the new event
I've merged into development for now. Code looks good but I sadly can't test it right now since I don't have a windows laptop at hand. But I will try to get one soon.
I noticed
onNativeBatteryLevelEvent
only returns battery level. However, upon reviewing the code, it appears that additional information such as charging status, full lifetime of battery in seconds, remaining battery life in seconds and power line status can be retrieved too. More detailed widgets can be created with these.A new event called
onNativeBatteryEvent
can return a JSON like this.(
onNativeBatteryLevelEvent
can be renamed toonNativeBatteryEvent
too.)The template battery widget can be updated to show charging status and remaining battery time with this new event.
I'm willing to create a pull request to implement this.
The text was updated successfully, but these errors were encountered: