Register a listener for system power/session events, or battery state changes.
The event to listen for. "change" fires whenever battery state changes; the rest are system power/session events.
"change"
Called with no arguments when the event occurs; call batteryInfo() inside a "change" listener to inspect the new battery state
Throws an Error on failure; wrap calls in try/catch to handle it.
Register a listener for system power/session events, or battery state changes.