watcher

Last updated 23 days ago

Watch for battery/power state changes

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

API Overview

  • Constructors - API calls which return an object, typically one that offers API methods

  • Methods - API calls which can only be made on an object returned by a constructor

API Documentation

Constructors

new

Signature

hs.battery.watcher.new(fn) -> watcher

Type

Constructor

Description

Creates a battery watcher

Parameters

Returns

Notes

Methods

start

Signature

hs.battery.watcher:start() -> self

Type

Method

Description

Starts the battery watcher

Parameters

Returns

stop

Signature

hs.battery.watcher:stop() -> self

Type

Method

Description

Stops the battery watcher

Parameters

Returns