cmd-johnson / node-power-info

Cross-platform node library for accessing battery power information
https://www.npmjs.com/package/node-power-info
MIT License
3 stars 2 forks source link

Broken on macOS 10.12 #3

Closed cmd-johnson closed 7 years ago

cmd-johnson commented 7 years ago

The output of pmset -g batt seems to have changed slightly since macOS 10.11:

Now drawing from 'AC Power'
 -InternalBattery-0 (id=3735651)    100%; charged; 0:00 remaining present: true

The regular expression responsible for parsing the output doesn't recognise the id field, fails and returns an empty array.