Skip to main content

Tuya Bulb Control - API wrapper for you smart bulbs developed by Tuya

Project description

Tuya Bulb Control

Tuya Bulb Control - API wrapper for you smart bulbs developed by Tuya

PyPi Versions Python versions Code Style


Installation

Install or upgrade tuya-bulb-control:

$ pip install tuya-bulb-control --upgrade

Or install source:

$ git clone https://github.com/Octoober/tuya-bulb-control.git
$ cd tuya-bulb-control
$ python setup.py install

Demo:

from tuya_bulb_control import Bulb

CLIENT_ID = ''
SECRET_KEY = ''
DEVICE_ID = ''
REGION_KEY = 'eu'

bulb = Bulb(
    client_id=CLIENT_ID,
    secret_key=SECRET_KEY,
    device_id=DEVICE_ID,
    region_key=REGION_KEY
)

# Turn on the bulb
bulb.turn_on()

# Change the color to green
bulb.set_colour_v2(rgb=(0, 255, 0))

# Turn off the light bulb after 5 minutes
bulb.set_toggle_timer(value=5)

Getting access to API

Step 1: CLIENT_ID and SECRET_KEY

  • Register or Login on Tuya.
  1. Create a cloud development project Cloud -> Project.
  2. After successful creation, you will receive the Client ID and Secret Key.

Step 2: DEVICE_ID

  1. Install Tuya Smart app or Smart Life app on your mobile phone.
  2. Go to Cloud -> Link Devices page.
  3. Selecting a tab Link Devices by App Account.
  4. Click Add App Account and scan the QR code with Tuya Smart app or Smart Life app.
  5. Now you can go to devices Cloud -> Device List and copy Device ID.
    • Notes: Try to select a your region if devices are not displayed.

Step 3: Request access to API calls

Go to Cloud -> API Group and enable Authorization management, Device Management and Device Control.

Done!

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

tuya_bulb_control-0.1b3.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file tuya_bulb_control-0.1b3.tar.gz.

File metadata

  • Download URL: tuya_bulb_control-0.1b3.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.6

File hashes

Hashes for tuya_bulb_control-0.1b3.tar.gz
Algorithm Hash digest
SHA256 a663c3244a25b8ce8fe085cf2b0864387d7fe3061b8e28a2c034affcb59c3823
MD5 9ebf247f2ab2b3430c657b4ab78a4aa0
BLAKE2b-256 b9d106ec295a207bb6ee6622dcfcc91cb52e7efd9e96d1300d66b3dc5bd30a3a

See more details on using hashes here.

Supported by

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