Battery Status
Battery Status
Importing Modules
import battery from '@system.battery'
API
getStatus
Gets the battery charging status charge (ChargeState type) and the battery level level. The battery level is an integer between .
Types
ChargeState
The ChargeState enum represents all battery charging states, defined as follows:
type ChargeState = 'charging' | 'discharging' | 'not-charging' | 'full'
The meaning of each value is:
'charging': The battery is charging;'discharging': The battery is discharging;'not-charging': The battery is not charging;'full': The battery is fully charged.
