Hue.Zone (Hue v0.2.0)

Copy Markdown View Source

Zones, addressed by name.

:ok = Hue.Zone.set(bridge, "Downstairs", brightness: 30)

A zone is a grouping that cuts across rooms — a light belongs to exactly one room but to any number of zones. Everything else is Hue.Room: the write goes to the zone's grouped_light service, and a zone owning none returns {:error, %Hue.Error{reason: :no_grouped_light}}.

Options are Hue.Light's, plus :await and :await_timeout — see Hue.Bridge.await_write/5.

Summary

Functions

Fetches one zone by name or rid.

Every zone the bridge knows about.

Queues a change to every light in a zone. See Hue.Light for options.

Functions

get(bridge, target)

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

Fetches one zone by name or rid.

list(bridge)

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

Every zone the bridge knows about.

set(bridge, target, options)

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

Queues a change to every light in a zone. See Hue.Light for options.