Python Hue V2
Python library to control the Philips Hue lighting system for Hue-V2 API.
Features
- Design for Hue API 2.0
High Level Control
Simple Example
import time
from python_hue_v2 import Hue, BridgeFinder
finder = BridgeFinder()
time.sleep(1) # wait for search
# Get server by mdns
host_name = finder.get_bridge_server_lists()[0] # Here we use first Hue Bridge
# or hue = Hue('ip address','app-key')
hue = Hue(host_name, 'hue app key') # create Hue instance
lights = hue.lights
for light in lights:
print(light.on)
light.on = True
light.brightness = 80.0
Scenes
You can get scenes from hue bridge.
from python_hue_v2 import Hue
hue = Hue('bridge-ip', 'app-key')
scenes = hue.scenes
for scene in scenes:
print(scene.id)
print(scene.data_dict)
Recall scene using active, dynamic_palette, static.
scene = scenes[0]
scene.recall(action='active')
Grouped Light
Get Lights from hue.
from python_hue_v2 import Hue
hue = Hue('bridge-ip', 'app-key')
grouped_lights = hue.grouped_lights
for group in grouped_lights:
print(group.type)
Low Level Control
Also, you can use basic function in bridge class.
import time
from python_hue_v2 import Hue
# or hue = Hue('ip address','app-key')
hue = Hue('host_name', 'hue app key') # create Hue instance
bridge = hue.bridge
bridge.get_lights()
bridge.set_light('id', light_property_name='on', property_value={'on': True})
bridge.get_zones()
TODO
- Zones, Rooms Control Class
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python_hue_v2-0.1.2.tar.gz
(10.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_hue_v2-0.1.2.tar.gz.
File metadata
- Download URL: python_hue_v2-0.1.2.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8ddd41b31a46f860e0a597848f85e2c93e6058ac9034146e7e6a1b8d2f915c
|
|
| MD5 |
6c548dc2432b5a397a15def3e48b7844
|
|
| BLAKE2b-256 |
21dc4470ce76edead3f482748d17767da27e879359464339bf2b2905b9ab0223
|
File details
Details for the file python_hue_v2-0.1.2-py3-none-any.whl.
File metadata
- Download URL: python_hue_v2-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.9.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1f877ff020e8d6b2a997ab317627b8ed1a669aebf089ae080dbf019cd1f4060
|
|
| MD5 |
762430e7b9259a08261ea9614cd901f0
|
|
| BLAKE2b-256 |
6cb8369fcd6678a45e836da25abe3fad7a28886aabf907b0d765453f650d15bf
|