NestGen2 (nest_gen2 v0.6.6)

Copy Markdown View Source

SDK for a rooted Nest Learning Thermostat (2nd gen).

Adding :nest_gen2 as a dependency starts the SDK: the backplate link and keep-alive, display, dial, piezo, backlight and power management.

Subscribe to events with subscribe/1; each arrives as {:nest_gen2, topic, payload}:

TopicPayload
:dial%{delta: degrees, angle: degrees}
:dial_step%{direction: :cw | :ccw, angle: degrees}
:light%{level: counts} (light flickering as someone moves nearby, or switched on)
:button:down | :up
:gesture:click | :double_click | :long_press (see NestGen2.Gesture)
:motion%{level: 0..10, near: boolean, far: boolean}
:climate%{temperature_c: float, humidity_pct: float}
:battery%{millivolts: integer}
:power:awake | :asleep

Summary

Functions

Subscribes the calling process to one topic or a list of topics.

Unsubscribes the calling process from one topic or a list of topics.

The SDK's version, e.g. "0.2.0".

Types

topic()

@type topic() ::
  :dial
  | :dial_step
  | :button
  | :gesture
  | :motion
  | :climate
  | :battery
  | :power

Functions

subscribe(topics)

@spec subscribe(topic() | [topic()]) :: :ok

Subscribes the calling process to one topic or a list of topics.

unsubscribe(topics)

@spec unsubscribe(topic() | [topic()]) :: :ok

Unsubscribes the calling process from one topic or a list of topics.

version()

@spec version() :: String.t()

The SDK's version, e.g. "0.2.0".