new changes

This commit is contained in:
akilan
2020-07-13 12:47:04 +04:00
parent 5c1a83272c
commit 82d55a625f
53 changed files with 3074 additions and 650 deletions

View File

@@ -46,6 +46,19 @@ class ClientInfo extends Base {
return super._patch(data);
}
/**
* Get current battery percentage and charging status for the attached device
* @returns {object} batteryStatus
* @returns {number} batteryStatus.battery - The current battery percentage
* @returns {boolean} batteryStatus.plugged - Indicates if the phone is plugged in (true) or not (false)
*/
async getBatteryStatus() {
return await this.client.pupPage.evaluate(() => {
const { battery, plugged } = window.Store.Conn;
return { battery, plugged };
});
}
}
module.exports = ClientInfo;