Skip to main content

The Unofficial LIFX CLI

Project description

The Unofficial LIFX CLI

Playing around with the LifX API with the goal of creating a feature-rich 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-0.68.0.tar.gz (7.5 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-0.68.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lifx_cli-0.68.0.tar.gz
Algorithm Hash digest
SHA256 6547ef463c662b49f9b006b90632ed3cc2076125c35a69190c8c728fb50dd2a2
MD5 bac27ed9b000fcbe4e58f59e8cc39578
BLAKE2b-256 6ffac4cb6a3d3388f69799500c073dad0ad72596d41ca006c305899682157f98

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for lifx_cli-0.68.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0da5c42081971d7db735872ca7e990790ed8ed7df958be89fb92c00472eb1f3f
MD5 fcf913e4be52fc9ec06359e56a676d24
BLAKE2b-256 1bf8f194b29e6195b28e2b0bcfd3f594add08667525bacd5a2ff1b5f6765d99e

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