static double oshi_batteryLevel() { PowerSource[] batteries = oshi_hardware().getPowerSources(); ret empty(batteries) ? nan() : first(batteries).getRemainingCapacity()*100; }
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1016190 |
Snippet name: | oshi_batteryLevel |
Eternal ID of this version: | #1016190/2 |
Text MD5: | c548a4a601b351df03d0943157836fc8 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-09 23:51:34 |
Source code size: | 183 bytes / 4 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 469 / 500 |
Version history: | 1 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1016191 - oshi_batteryLevel_withZeroPercentFix #1018426 - oshi_sensors #1019504 - oshi_powerSources |