Google celebrates Hispanic Heritage Month. See how.

lights-cli

Get information about lights and control their brightness.

Usage

lights-cli print <id>
lights-cli set <id> <value>
lights-cli summary

Commands

print

lights-cli print <id>

View the brightness of a light. The reported brightness value is a floating point number between 0.0 (completely off) and 1.0 (completely on).

set

lights-cli set <id> <brightness>

Set the brightness of a light. For lights that support pulse-width modulation <brightness> can be any number between 0.0 (completely off) and 1.0 (completely on). For lights that only support simple on and off states <brightness> should only be 0.0 (off) or 1.0 (on).

summary

lights-cli summary

View the total light count as well as the brightness and capabilities of each light. Currently supported capabilities are Brightness, Rgb, and Simple. Brightness is a value between 0.0 and 1.0 as explained in the set command's description. Rgb is the RGB value of the light. Simple indicates whether the light supports pulse-width modulation or only simple on and off states.

Examples

View the brightness of a light

$ lights-cli print AMBER_LED
Value of AMBER_LED: 1.000000

Set the brightness of a light

$ lights-cli set AMBER_LED 0.5
# This command exits silently.

View the total light count and each light's brightness and capabilities

$ lights-cli summary
Total 1 lights
Value of AMBER_LED: 0.500000
    Capabilities: Brightness

Notes

Accessing this command

This command is only available on certain diagnostic and testing Fuchsia builds.

This is a device-side command, not a host-side command like fx or ffx. In other words before calling this command you must first access the shell of the Fuchsia device.

To interactively access the Fuchsia device's shell:

ffx component explore <component>

Replace <component> with the name of the component that has access to the command documented on this page.

To call a single command and return the output to the host:

ffx component explore <component> -c "<command>"

Replace <command> with one of the commands documented on this page.

Source code

Source code for lights-cli: //src/ui/light/bin/lights-cli/