Library to control Casambi light through cloudapi
Project description
Python library for controlling Casambi lights
Python library for controlling Casambi via Cloud API
Getting Started
- Request developer api key from Casambi: https://developer.casambi.com/
- Setup a site in Casambi app: http://support.casambi.com/support/solutions/articles/12000041325-how-to-create-a-site
Installating
Install this library through pip:
pip install casambi
Example Code block 1
import casambi
import time
api_key = 'REPLACEME'
email = 'replaceme@replace.com'
network_password = 'REPLACEME'
user_password = 'REPLACEME'
worker = casambi.Casambi(api_key=api_key, email=email, \
user_password=user_password, network_password=network_password)
worker.create_user_session()
worker.create_network_session()
worker.ws_open()
print("Turn unit on!")
worker.turn_unit_on(unit_id=1)
time.sleep(60)
print("Turn unit off!")
worker.turn_unit_off(unit_id=1)
time.sleep(60)
units = worker.get_unit_list()
print("units: {}".format(units))
scenes = worker.get_scenes_list()
print("Scene on!")
worker.turn_scene_on(scene_id=1)
time.sleep(60)
print("Scene off!")
worker.turn_scene_off(scene_id=1)
worker.ws_close()
Other Casambi projects
- https://github.com/hellqvio86/aiocasambi - Asynchronous I/O version of this library
- https://github.com/hellqvio86/home_assistant_casambi - Home Assistant Plugin for Casambi
- https://github.com/awahlig/homebridge-casambi Homebridge plugin for Casambi
Authors
- Olof Hellqvist - Initial work
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Disclaimer
This library is neither affiliated with nor endorsed by Casambi.
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
casambi-0.159.tar.gz
(7.8 kB
view details)
Built Distribution
File details
Details for the file casambi-0.159.tar.gz
.
File metadata
- Download URL: casambi-0.159.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
77e258754afb78317f4dfafa9ff6c86cb787db6d7408a9ce750a4f4b52249be7
|
|
MD5 |
bd806a6e636eec89c7569abf40d71aaf
|
|
BLAKE2b-256 |
389571e10284d21de3f83cd7fa839bfaac777797dba9b9c6c2c2de9f5e57a7f1
|
File details
Details for the file casambi-0.159-py3-none-any.whl
.
File metadata
- Download URL: casambi-0.159-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
ffa89b256ad56b1f05cae6ddfac739220ae9e0d2309cd77516549930cb9ad10a
|
|
MD5 |
d4fb54821a97fdf9403ff75d9c654209
|
|
BLAKE2b-256 |
57d03805fc5c9e7b5d2def2ab10f2f356480867e6bd309d4adcf642b0bb306ad
|