Skip to main content

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 Phue. Check it out :)

Metadata

Release files for hue-snek-channel42 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hue-snek-channel42 0.3
File Size Uploaded Provenance Actions
hue-snek-channel42-0.3.tar.gz 5.1 kB Without provenance Details for hue-snek-channel42-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hue-snek-channel42 0.3
File Interpreter ABI Platform Actions
hue_snek_channel42-0.3-py3-none-any.whl Python 3 none any Details for hue_snek_channel42-0.3-py3-none-any.whl

Total release size: 11.2 kB

Release files / hue-snek-channel42-0.3.tar.gz

Download URL hue-snek-channel42-0.3.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a7a9c42fde46c2775f7126bd85f055dbcab532e173b227d0d63ae82e51aeafd8
BLAKE2b-256 checksum
How to use checksums
3caed5ac524caa6b25bd34973201048294c4735098d17f15674ef7b13f6edfc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.8.2

Release files / hue_snek_channel42-0.3-py3-none-any.whl

Download URL hue_snek_channel42-0.3-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
787f7ff63ab007c204a4fc8dff70c66f716a6c0ab0753cbd475834bd8760dedf
BLAKE2b-256 checksum
How to use checksums
4561963413cb08e7e9611ad04ec65530287fbbff60265140cb7e6060f87f4814
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.8.2

Security for hue-snek-channel42 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page