{"id":26138441,"url":"https://github.com/octoober/tuya-bulb-control","last_synced_at":"2025-04-14T00:08:49.076Z","repository":{"id":49327590,"uuid":"329126386","full_name":"Octoober/tuya-bulb-control","owner":"Octoober","description":"API wrapper for you smart bulbs developed by Tuya 💡","archived":false,"fork":false,"pushed_at":"2024-02-16T12:20:15.000Z","size":27,"stargazers_count":36,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-14T00:08:11.166Z","etag":null,"topics":["api-wrapper","smart-bulb","tuya","tuya-api","tuya-smart"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Octoober.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-01-12T22:15:19.000Z","updated_at":"2025-02-21T20:47:47.000Z","dependencies_parsed_at":"2024-02-16T13:30:24.592Z","dependency_job_id":"dc885bd7-d55e-4850-afc5-f9b3ba34465e","html_url":"https://github.com/Octoober/tuya-bulb-control","commit_stats":{"total_commits":10,"total_committers":2,"mean_commits":5.0,"dds":"0.19999999999999996","last_synced_commit":"a4dd71c3529aed21ca976fdc1d91c47fda29a99b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoober%2Ftuya-bulb-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoober%2Ftuya-bulb-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoober%2Ftuya-bulb-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Octoober%2Ftuya-bulb-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Octoober","download_url":"https://codeload.github.com/Octoober/tuya-bulb-control/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799955,"owners_count":21163404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-wrapper","smart-bulb","tuya","tuya-api","tuya-smart"],"created_at":"2025-03-11T01:58:32.306Z","updated_at":"2025-04-14T00:08:49.040Z","avatar_url":"https://github.com/Octoober.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tuya Bulb Control #\n\nTuya Bulb Control - API wrapper for you smart bulbs \u003ca href=\"https://www.tuya.com\" target=\"_blanck\"\u003e**developed by Tuya**\u003c/a\u003e\n\n[![PyPi Versions](https://img.shields.io/pypi/v/tuya-bulb-control.svg)](https://pypi.org/project/tuya-bulb-control/)\n[![Python versions](https://img.shields.io/pypi/pyversions/tuya_bulb_control.svg)](https://pypi.org/project/tuya-bulb-control/)\n[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black/)\n\n---\n## Installation\nInstall or upgrade tuya-bulb-control:\n```\n$ pip install tuya-bulb-control --upgrade\n```\nOr install source:\n```\n$ git clone https://github.com/Octoober/tuya-bulb-control.git\n$ cd tuya-bulb-control\n$ python setup.py install\n```\n\nDemo:\n```Python\nfrom tuya_bulb_control import Bulb\n\nCLIENT_ID = ''\nSECRET_KEY = ''\nDEVICE_ID = ''\nREGION_KEY = 'eu'\n\nbulb = Bulb(\n    client_id=CLIENT_ID,\n    secret_key=SECRET_KEY,\n    device_id=DEVICE_ID,\n    region_key=REGION_KEY\n)\n\n# Turn on the bulb\nbulb.turn_on()\n\n# Change the color to green\nbulb.set_colour_v2(rgb=(0, 255, 0))\n\n# Turn off the light bulb after 5 minutes\nbulb.set_toggle_timer(value=5)\n```\n\n## Getting access to API\n#### Step 1: CLIENT_ID and SECRET_KEY\n- Register or Login on \u003ca href=\"https://auth.tuya.com\" target=\"_blanck\"\u003eTuya\u003c/a\u003e.\n1. Create a cloud development project \u003ca href=\"https://iot.tuya.com/cloud\" target=\"_blanck\"\u003eCloud -\u003e Project\u003c/a\u003e.\n2. After successful creation, you will receive the **Client ID** and **Secret Key**.\n\n\n#### Step 2: DEVICE_ID\n1. Install **Tuya Smart** app or **Smart Life** app on your mobile phone.\n2. Go to \u003ca href=\"https://iot.tuya.com/cloud/appinfo/cappId/device\" target=\"_blanck\"\u003eCloud -\u003e Link Devices\u003c/a\u003e page.\n3. Selecting a tab **Link Devices by App Account**.\n4. Click **Add App Account** and scan the QR code with **Tuya Smart** app or **Smart Life** app.\n5. Now you can go to devices \u003ca href=\"https://iot.tuya.com/cloud/appinfo/cappId/deviceList\" target=\"_blanck\"\u003eCloud -\u003e Device List\u003c/a\u003e and copy **Device ID**.\n    * Notes: Try to select a your region if devices are not displayed.\n\n\n#### Step 3: Request access to API calls\nGo to \u003ca href=\"https://iot.tuya.com/cloud/appinfo/cappId/setting\" target=\"_blanck\"\u003eCloud -\u003e API Group\u003c/a\u003e and enable **Authorization management**, **Device Management** and **Device Control**.\n\n**Done!**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoober%2Ftuya-bulb-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctoober%2Ftuya-bulb-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctoober%2Ftuya-bulb-control/lists"}