NestGen2.Host (nest_gen2 v0.6.6)

Copy Markdown View Source

Running an app on a computer instead of a Nest, for developing and testing screens without deploying (see docs/host.md).

With config :nest_gen2, target: :host the SDK starts as usual but touches no hardware: the screen is drawn in memory (NestGen2.Display.snapshot/0), the ring and its press come from these functions or the browser viewer (NestGen2.Host.Viewer), the climate is a steady simulated reading, and deep sleep, the clock and Wi-Fi are left alone.

These functions produce the same events as the real hardware, so the app can't tell the difference.

Summary

Functions

A short press of the ring.

Sets the simulated room reading and sends it as a :climate event.

Two quick presses (a :double_click gesture).

A press held long enough for a :long_press gesture.

Someone moving near the Nest (wakes the screen if motion is a wake source).

The screen as a PNG.

Turns the ring one step (NestGen2.Dial.set_step/1) clockwise or anticlockwise.

Turns the ring by degrees, clockwise if positive.

Functions

click()

@spec click() :: :ok

A short press of the ring.

climate(temperature_c, humidity_pct)

@spec climate(number(), number()) :: :ok

Sets the simulated room reading and sends it as a :climate event.

double_click()

@spec double_click() :: :ok

Two quick presses (a :double_click gesture).

long_press()

@spec long_press() :: :ok

A press held long enough for a :long_press gesture.

motion(level \\ 5)

@spec motion(0..10) :: :ok

Someone moving near the Nest (wakes the screen if motion is a wake source).

screenshot()

@spec screenshot() :: binary()

The screen as a PNG.

step(direction)

@spec step(:cw | :ccw) :: :ok

Turns the ring one step (NestGen2.Dial.set_step/1) clockwise or anticlockwise.

turn(degrees)

@spec turn(number()) :: :ok

Turns the ring by degrees, clockwise if positive.