Skip to main content

The Unofficial LIFX CLI

Project description

The Unofficial LIFX CLI Latest Version

CI/CDLinterTestsLicensePython-Support

██      ██ ███████ ██   ██      ██████ ██      ██
██      ██ ██       ██ ██      ██      ██      ██
██      ██ █████     ███       ██      ██      ██
██      ██ ██       ██ ██      ██      ██      ██
███████ ██ ██      ██   ██      ██████ ███████ ██

This project is not affiliated with or endorsed by LIFX.

Installation

pip install lifx-cli

Authentication

Authentication is done using your token stored in ~/.keys. This can be configured manually or by running lifx --configure.

Example ~/.keys ini file:

[lifx]
token = FAKE_TOKEN

Alternatively, you can override this value by setting the LIFX environment variable:

export LIFX=FAKE_TOKEN

Refer to the documentation in order to generate your own token.

Targeting Lights

The LIFX CLI primary uses device/group/scene IDs to operate, however LIFX does provide multiple options for the light 'selectors'. While not yet officially available via the CLI, you can tap into these options by prefacing your light ID accordingly (if there are spaces in the name, simply enclose in ").

lifx lights --toggle all
lifx lights --toggle "label:Left Lamp"
lifx lights --toggle "group: Upstairs Lights"
lifx lights --toggle "location_id:1d6fe8ef0fde4c6d77b0012dc736662c"
lifx lights --toggle "location:Home"

Finding the Proper ID

In order to get a listing of device and group IDs, simply run --list with the lights sub-command.

lifx lights --list

In order to get a listing of scene IDs, run the same command for scenes.

lifx scenes --list

Setting colors

Colors can be set by name, e.g. red, yellow, but the CLI also supports all methods to set the color that the API supports.

In order to see a full list of supported methods run lifx colors --list. You can also validate a color's HSBK (hue, saturation, brightness, and kelvin) via lifx colors --color red.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lifx_cli-2.5.6.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lifx_cli-2.5.6-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file lifx_cli-2.5.6.tar.gz.

File metadata

  • Download URL: lifx_cli-2.5.6.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for lifx_cli-2.5.6.tar.gz
Algorithm Hash digest
SHA256 9371a8e2705ab81b6fa076b3122499c8cc6c1a126340dd58e56788e8b2da37b3
MD5 6cb67c19d0a8abbf2d89cfe6b03fe5b9
BLAKE2b-256 093bbfa5606e9737c757fe783f8574f29bae84aa2b63a1c264ced9ce6d95cd2b

See more details on using hashes here.

File details

Details for the file lifx_cli-2.5.6-py3-none-any.whl.

File metadata

  • Download URL: lifx_cli-2.5.6-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for lifx_cli-2.5.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9547db3c39221f1e42f764a5d208268db03cbad68ba9e3c54c11f77712778521
MD5 18390036181910f20cf8ff80fe0d6bc4
BLAKE2b-256 65a9143211ff80fe37f71a2530e4edc72280af00836dd8d23058f7b4ebac7f3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page