python sdk for philips hue
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
pyhue pyhue lib. Aug 9, 2013
.gitignore pyhue lib. Aug 9, 2013
README.md Add a Bitdeli badge to README Mar 6, 2014
setup.py pyhue lib. Aug 9, 2013

README.md

pyhue

This is a simple python sdk for philips hue (personal lightting system).

Version 0.1.2 is RELEASED

How to use

This should be very easy.

Prepare

  1. git clone the code
  2. python setup.py install

Config

If you are not write the config file, it will generate auto with ip 0.0.0.0 . You need to config it.

Simple way:

python
from pyhue.nupnp import get_hue
h = get_hue()

This will gen config.yml auto and auto fill the station_ip and deveice_type.

Or:

python
from pyhue import Hue
h = Hue()

Then there will be a config.yml file in $HOMEDIR/.hue/.

Auth

This will geb/load the config file at $HOMEDIR

from pyhue import hue
hue = Hue()

or

hue = Hue(filename='test.yml')

or

hue = Hue(ip, devicetype)

Then run (only the first time)

hue = auth()

get to your hue and press the BUTTON

and Done

Usage

next time you just can do like the main.py

lights = hue.lights
light = lights[0]
light.on()
light.off()
light.set_state()

can you also could use hue object

hue.create_schedule()
hue.get_new_lights()

Next

main.py have some simple samples.

Chinese

  1. 下载代码
  2. www.meethue.com/api/nupnp 页面获取信息
  3. 修改config文件, $HOMEDIR/.hue/config.yml
  4. 使用代码,h=Hue()
  5. h.auth()认证,并按下hue的按钮
  6. 认证完毕

Contact

soundbbg at gmail

Bitdeli Badge