View Source HueSDK.Bridge (HueSDK v0.1.1)

Interface to the Hue Bridge device, required to call functions in the HueSDK.API namespace.

Link to this section Summary

Types

A unique identifier to register with the Hue Bridge API.

t()

Stateless struct containing Hue Bridge device information.

Functions

Authenticates a new devicetype/0 with the Hue Bridge REST API. For authentication to succeed, the link button on the Hue Bridge device must be pressed within 30 seconds of invoking this function.

Link to this section Types

@type devicetype() :: String.t()

A unique identifier to register with the Hue Bridge API.

examples

Examples

"connorlay#huesdk"
@type t() :: %HueSDK.Bridge{
  api_version: term(),
  bridge_id: term(),
  datastore_version: term(),
  host: term(),
  mac: term(),
  model_id: term(),
  name: term(),
  sw_version: term(),
  username: term()
}

Stateless struct containing Hue Bridge device information.

examples

Examples

%HueSDK.Bridge{
  api_version: "1.42.0",
  bridge_id: "EGB5FAFAFE196528",
  datastore_version: "99",
  host: "192.168.1.2",
  mac: "f0:dd:e5:1f:38:cd",
  model_id: "BSB002",
  name: "My Hue Bridge",
  sw_version: "1943082030",
  username: "Ht-Flaev-p7Vk5ryJinxKwlYdQupdEXL4c5lKLXL"
}

Link to this section Functions

Link to this function

authenticate(bridge, devicetype)

View Source
@spec authenticate(t(), devicetype()) :: t()

Authenticates a new devicetype/0 with the Hue Bridge REST API. For authentication to succeed, the link button on the Hue Bridge device must be pressed within 30 seconds of invoking this function.

examples

Examples

HueSDK.Bridge.authenticate(bridge, "connorlay#huesdk")

%HueSDK.Bridge{
 username: "Ht-Flaev-p7Vk5ryJinxKwlYdQupdEXL4c5lKLXL",
 # ...
}