An open API service indexing awesome lists of open source software.

https://github.com/phdenzel/licht

A GTK-based systray applet and command-line tool for Philips Hue bridge
https://github.com/phdenzel/licht

applet command-line-tool gtk python

Last synced: 7 months ago
JSON representation

A GTK-based systray applet and command-line tool for Philips Hue bridge

Awesome Lists containing this project

README

          

`licht` is a command-line program (including a GTK applet) which
fetches info from a local Philips Hue bridge in your network and
enables you to apply basic operations, such as turning lights on/off,
dimming, color-temperature changing, etc.

I was looking for a lightweight program for Philips Hue, but
unfortunately most don't run (stable) on Arch linux, so I decided to
write it myself.

# Prerequisites

This program mainly uses following python3 modules

- requests
- pyyaml
- pycairo
- PyGObject

The PyGObject dependencies additionally require some packages to
be installed on your distribution. For a detailed overview see
[pygobject.readthedocs.io/en/latest/getting_started.html](https://pygobject.readthedocs.io/en/latest/getting_started.html).

For Arch linux use:

sudo pacman -S python cairo pkgconf gobject-introspection gtk3

# Install

pip install licht

For installing from source, clone the repository, and run

cd licht
python setup.py install --user

or create a virtual environment with

pipenv install
pipenv install -e .

To activate the virtual environment run

pipenv shell

or start every command with `pipenv run`.

# Usage

To start a daemon, run `licht --daemon`.

usage: licht [-h] [-d] [-a] [--lights] [--groups] [--scenes] [-l ] [-g ] [-s ]
[-p ] [-o {true,false,1,0,yes,no,y,n}] [-b ] [-t ] [-u ]
[--register] [-c ] [--section ] [--dark-icon] [--output ] [-v]

options:
-h, --help show this help message and exit
-d, --daemon Run the Licht applet as a daemon process
-a, --app, --applet Run the Licht applet
--lights, --list-lights
List the index of lights in the network
--groups, --list-groups
List the index of groups in the network
--scenes, --list-scenes
List the index of groups in the network
-l , --light , --light-id
Light-id for state change
-g , --group , --group-id
Group-id for state change
-s , --scene , --scene-id
Scene-id for state change
-p , --subpath
Subpath for state change
-o {true,false,1,0,yes,no,y,n}, --on {true,false,1,0,yes,no,y,n}
Toggle lights on
-b , --bri
Update for the brightness value [0-255]
-t , --ct
Update for the color temperature value [0-65535]
-u , --update
Update body for the PUT request
--register Authenticate licht and receive a username from bridge
-c , --config
Path to the config file
--section Section in the yaml file to be parsed
--dark-icon Use a dark icon on systray (for light themes)
--output Set the path of the output log-file
-v, --verbose Run program in verbose mode

# Configuration

`licht` works with both command-line arguments as well as YAML
configuration files (the first takes precedence over the latter). To
set your desired defaults, edit the configuration file
`licht_example.yml` and place it in either

- `~/.config/licht/licht.yml`
- `~/.config/.licht.yml`
- `~/.licht/licht.yml`
- `~/.licht.yml`