安装
npm i --save magic-battery
用法
下面的脚本将返回BatteryPercentage类对象的列表,其中包含以下字段:deviceName,batteryPercent
let magic_battery = require ( 'magic-battery' ) ;
magic_battery . getBatteryPercentageInfo ( 10000 ) . subscribe (
info => {
console . log ( info ) ;
}
)