mjolnir._asm.watcher.battery

Home: https://github.com/asmagill/mjolnir_asm.watcher

Functions for watching battery state changes.

This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.

new

mjolnir._asm.watcher.battery.new(fn) -> watcher

Creates a battery watcher that can be started. When started, fn will be called each time a battery attribute changes.

start

mjolnir._asm.watcher.battery:start() -> self

Starts the battery watcher, making it so fn is called each time a battery attribute changes.

stop

mjolnir._asm.watcher.battery:stop() -> self

Stops the battery watcher's fn from getting called until started again.