CLI utility for controlling smart lamps
MIT License
A small CLI utility for controlling smart lamps.
Currently only Philips Hue lamps are supported, but adding support for other backends is easy.
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 variableDEFAULT_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
python3 -m venv venv
source venv/bin/activate
pip3 install wheel
pip3 install -r requirements.txt
lampctl
with python3 -m lampctl ...
python3 -m unittest
in this directorypip3 install .
PATH
you should now be able to invoke lampctl
from anywhere