Skip to main content

Lampctl

PyPI Test

A small CLI utility for controlling smart lamps.

Icon

Currently only Philips Hue lamps are supported, but adding support for other backends is easy.

Usage

To use, first create the file ~/.config/lampctl/config.json pointing to your lamp systems:

{
  "systems": [
    {
      "type": "hue",
      "bridge-ip": "your.ip.here"
    }
  ],
  "default-lamp": "My Lamp"
}

If no default-lamp is set you can use the environment variable DEFAULT_LAMP or -n to select a lamp to control.

Now you can use the CLI to control your lamps. For example:

lampctl on               # turn selected lamp on
lampctl off              # turn selected lamp off
lampctl toggle           # toggle selected lamps
lampctl color blue       # set selected lamps to blue
lampctl dim 50           # dim selected lamps to 50%
lampctl --all on         # turn all lamps on
lampctl list             # list all lamps
lampctl status           # list selected lamps
lampctl -n "My Lamp" on  # turn lamp with name `MyLamp` on

Development

  • Optionally setup a virtual environment:
    • Create a venv using python3 -m venv venv
    • Activate the venv using source venv/bin/activate
  • Make sure that Wheel is installed using pip3 install wheel
  • Finally install the dependencies with pip3 install -r requirements.txt
  • Now you can run lampctl with python3 -m lampctl ...
  • To run the test suite, invoke python3 -m unittest in this directory

Installation

  • First make sure you are not in a virtual environment
  • Then run pip3 install .
  • If your Python packages are available on your PATH you should now be able to invoke lampctl from anywhere

Release files for lampctl 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lampctl 0.1.2
File Size Uploaded
lampctl-0.1.2.tar.gz 8.8 kB Details

Release files / lampctl-0.1.2.tar.gz

Download URL lampctl-0.1.2.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0d3623f2ecaae198f39e10b1ff5738fe8994d561cfab945e042c807c206fcfd9
BLAKE2b-256 checksum
How to use checksums
7d82a6a9df2725a75e729718bd3bc0bb0c482b0bb93cbd1dfe58c8ba308755b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page