PowerMonitor

external interface PowerMonitor : EventEmitter(source)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract var onBatteryPower: Boolean

A boolean property. True if the system is on battery power.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard
fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard

The system's current thermal state. Can be unknown, nominal, fair, serious, or critical.

Link copied to clipboard
Link copied to clipboard

The system's current idle state. Can be active, idle, locked or unknown.

Link copied to clipboard
abstract fun getSystemIdleTime(): Double

Idle time in seconds

Link copied to clipboard
abstract fun isOnBatteryPower(): Boolean

Whether the system is on battery power.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun off(type: EventType, listener: EventListener)
Link copied to clipboard
fun on(type: EventType, listener: EventListener)
Link copied to clipboard
fun once(type: EventType, listener: EventListener)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard