LedringAnimation

This class contains an animation that can be played on Homey's LED Ring.

Table of Contents

Methods

(async) registerScreensaver(screensaverName) → {Promise.<any>}

Register this animation as a screensaver. This is a shorthand method to ManagerLedring#registerScreensaver.

Parameters:
Name Type Description
screensaverName String

The name of the screensaver, as defined in /app.json

Returns:
Type:
Promise.<any>

(async) start() → {Promise.<any>}

Start the animation.

Returns:
Type:
Promise.<any>

(async) stop() → {Promise.<any>}

Stop the animation.

Returns:
Type:
Promise.<any>

(async) unregister() → {Promise.<LedringAnimation>}

Unregister the animation. This is a shorthand method to ManagerLedring#unregisterAnimation.

Returns:
Type:
Promise.<LedringAnimation>

(async) unregisterScreensaver(screensaverName) → {Promise.<any>}

Unregister this animation as a screensaver. This is a shorthand method to ManagerLedring#unregisterScreensaver.

Parameters:
Name Type Description
screensaverName String

The name of the screensaver, as defined in /app.json

Returns:
Type:
Promise.<any>

(async) updateFrames(frames) → {Promise.<any>}

Update the animation frames.

Parameters:
Name Type Description
frames Array.<LedringAnimation.Frame>
Returns:
Type:
Promise.<any>

Type Definitions

Frame

Properties:
Name Type Description
r number

between 0 and 255.

g number

between 0 and 255.

b number

between 0 and 255.

Events

.on('finish')

When the animation has finished (duration has been reached)

.on('start')

When the animation has started

.on('stop')

When the animation has stopped