A library for the Philips Hue API
Project description
hue_snek
A python Library for the Philips Hue API
About
hue_snek is a python library for the Philips Hue API, that allows for easy API integration into other projects. The goal of this library is to provide the basic functions needed to interact with the Hue API, without unecessary functions.
I will add more documentation and progress reports in the following days.
Features
- connect to bridge
- get light information (name, state, modelname, etc.)
- set light parameters (on/off, brightness, hue, etc.)
- get group information (name, on/off, colormode, etc.)
- set group parameters (on/off, brightness, hue, etc.)
- get scene information (name, assigned group(s), etc.)
- set scene for group (via scene name)
- get bridge information (name, mac, api-version, etc.)
WIP
- Documentation
Example
Basic usage of this library:
from hue_snek import Hue, Light
#setup bridge
h = Hue('your.ip.here', 'generic-username')
#to check the connection to the bridge use:
h.checkup() #returns 0 if connection and username OK
#to get Light information use either the Light or Hue class
#Light
Light(1, h).name #(light id, bridge)
Light(1, h).brightness #properties: name, brightness, hue, saturation, state
#Hue
h.get_light(2, 'name') #parameters: see hue api
h.get_lights('id') #modes: obj (default, id, name, modelid
h.get_group(1, 'name') #parameters: see hue api
h.get_groups('name') #modes: all (default), name, type
#to set lights or groups use either the Light or Hue Class
#Light
Light(2, h).set('bri', '124')
#Hue
h.set_light(1, 'on', 'true')
h.set_group(1, 'on', 'true')
#scenes can be accessed and set like this:
h.get_scenes('name') #modes: all (default), name, group
h.set_scene(1, 'Chill') #(group id, scene name)
info = h.get_bridge_info()
for param, value in info.items():
print(param, value)
Notes
This project was inspired by . Check it out :)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hue-snek-channel42-0.3.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for hue_snek_channel42-0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 787f7ff63ab007c204a4fc8dff70c66f716a6c0ab0753cbd475834bd8760dedf |
|
MD5 | e40708a12c2a835debc8f332e0b55825 |
|
BLAKE2b-256 | 4561963413cb08e7e9611ad04ec65530287fbbff60265140cb7e6060f87f4814 |