Hue.Scene (Hue v0.2.0)

Copy Markdown View Source

Scenes, addressed by name.

:ok = Hue.Scene.recall(bridge, "Relax")
:ok = Hue.Scene.recall(bridge, "Relax", duration: 2_000)

A scene is not a group and takes none of Hue.Light's options — its whole content is the state it puts its lights into. Recall is a write to the scene itself, and the only thing you get to say about it is how long the transition should take.

Summary

Functions

Fetches one scene by name or rid.

Every scene the bridge knows about.

Functions

get(bridge, target)

@spec get(atom(), String.t()) :: {:ok, map()} | {:error, Hue.Error.t()}

Fetches one scene by name or rid.

list(bridge)

@spec list(atom()) :: {:ok, [map()]} | {:error, Hue.Error.t()}

Every scene the bridge knows about.

recall(bridge, target, options \\ [])

@spec recall(atom(), String.t(), keyword()) :: :ok | {:error, Hue.Error.t()}

Activates a scene.

:duration is milliseconds for the transition into the scene. :await and :await_timeout wait for the confirming event — see Hue.Bridge.await_write/5.