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.165.tar.gz
(8.6 kB
view details)
Built Distribution
File details
Details for the file casambi-0.165.tar.gz
.
File metadata
- Download URL: casambi-0.165.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57643f714c334dadb563f223889b97e3041efd23a141c99a5d735c59032239c3 |
|
MD5 | 443a6dfb0165351b258b89456a4186b0 |
|
BLAKE2b-256 | 9fa2e27dd7dd893f7549bc67e85c2997f383b6f79220deedd6464ff8fd4d249b |
File details
Details for the file casambi-0.165-py3-none-any.whl
.
File metadata
- Download URL: casambi-0.165-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9994b982ae47287cc0712670ba38e8d1c015fd417339dbe2872d671134397428 |
|
MD5 | 183c2b80499118bdeef4134939cd89b6 |
|
BLAKE2b-256 | 58325b0efbff4e05e3df30b96b2a48d14be8276c3247ac4eea222b5a83d3a824 |