# `NestGen2.Light`
[🔗](https://github.com/integration-technology/nest_gen2_sdk/blob/v0.6.6/lib/nest_gen2/sensors.ex#L61)

The backplate's ambient light sensor (raw counts, once a second).

Someone moving near the thermostat makes the light flicker: within a few
seconds it both drops and rises as their shadow passes. Clouds change the
light just as much, but steadily in one direction. A flicker, or a sudden
jump such as a light being switched on, is published as a `:light` event
`%{level: counts}`.

`:light` is one of the default wake sources, because the backplate's motion
sensors can stop reporting for minutes after a long quiet spell.

Over the last 5 samples, it counts when:

  * the light both fell and rose by `:light_wake_flicker_pct` percent or more
    from one second to the next (default 6), or
  * it changed by `:light_wake_jump_pct` percent or more in one second
    (default 40).

Changes smaller than `:light_wake_min_delta` counts (default 200) are
ignored, so noise in the dark doesn't count.

# `level`

```elixir
@spec level() :: non_neg_integer() | nil
```

Latest raw light level, or nil before the first reading.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
