Skip to main content

Library to control Casambi light through cloudapi

Project description

PyPI - Python Version PyPI GitHub GitHub issues GitHub last commit PyPI - Downloads

Python library for controlling Casambi lights

Python library for controlling Casambi via Cloud API

Getting Started

  1. Request developer api key from Casambi: https://developer.casambi.com/
  2. 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

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


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.158.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

casambi-0.158-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file casambi-0.158.tar.gz.

File metadata

  • Download URL: casambi-0.158.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

Hashes for casambi-0.158.tar.gz
Algorithm Hash digest
SHA256 1857b23f4bc5cff3e2a46f1c13136214d6f3ae9d7618e0fa04ee52c978374a5a
MD5 e3a6ba74f1d82380a6de973430681fc5
BLAKE2b-256 90f8db84a660ca09a0c5649c7c96d398d383b145374b69098b7784e699a6b211

See more details on using hashes here.

File details

Details for the file casambi-0.158-py3-none-any.whl.

File metadata

  • Download URL: casambi-0.158-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

Hashes for casambi-0.158-py3-none-any.whl
Algorithm Hash digest
SHA256 e341bf4a4c59765ad7aad393ad2544f0973a416d556b81106cb525bdd86bc72f
MD5 fe54706d85cbab4eb061b6d956bbd2f5
BLAKE2b-256 5f417fc4f7c280b56e7d3a696646ed98d6531b9f3f907791536f1bc18f47746a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page