{"id":21927778,"url":"https://github.com/tuyaapi/local-control-api-ideas","last_synced_at":"2026-02-10T23:31:21.452Z","repository":{"id":102301990,"uuid":"384467830","full_name":"TuyaAPI/local-control-api-ideas","owner":"TuyaAPI","description":"Brainstorming a local control interface for Tuya devices","archived":false,"fork":false,"pushed_at":"2023-12-15T05:39:40.000Z","size":3,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-23T06:12:03.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TuyaAPI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2021-07-09T14:49:16.000Z","updated_at":"2021-07-14T03:29:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9bec3a2-a7e1-4057-9826-fdfbfc84987c","html_url":"https://github.com/TuyaAPI/local-control-api-ideas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TuyaAPI/local-control-api-ideas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuyaAPI%2Flocal-control-api-ideas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuyaAPI%2Flocal-control-api-ideas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuyaAPI%2Flocal-control-api-ideas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuyaAPI%2Flocal-control-api-ideas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TuyaAPI","download_url":"https://codeload.github.com/TuyaAPI/local-control-api-ideas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TuyaAPI%2Flocal-control-api-ideas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29321332,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T20:44:44.282Z","status":"ssl_error","status_checked_at":"2026-02-10T20:44:43.393Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-28T22:17:33.776Z","updated_at":"2026-02-10T23:31:21.423Z","avatar_url":"https://github.com/TuyaAPI.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# local-control-api-ideas\nBrainstorming a local control interface for Tuya devices\n\nSee: https://github.com/codetheweb/tuyapi/discussions/501\n\nNote that everything described below are just ideas / suggestions, even though they may be phrased differently. Take them or leave them.\n\n# Overview\n\nThere should be two layers to the API. One for low-level, direct communcation where the API consumer manually sets and decodes / encodes DPS data. Then, there should be a layer built on top of that to facilitate easier use. For example, a lower-level call may look like `set({dps: 2, value: 'ffff8006ff000000'})`; whereas a higher-level call might look like `fadeTo({hex: '#ffffff'})`. This allows the API consumer to choose what level of abstraction they want for their specific use-case.\n\n## The driver (low level)\n\n- The device's state should be continuously and proactively updated \u0026 stored in a property rather than being fetched through a function (i.e. `print(device.dps)` instead of `print(device.get())` which would send a request to the device and be blocking).\n- As many error cases as possible need to be covered (device disconnects from network, misses the ocasional heartbeat, sends bad data back, etc). When thrown, these errors need to be descriptive and actionable. `Error: device didn't understand request` is far better than `Error: bad data`.\n\n## The library on top (high level)\n\n- There should be convenience functions for every device type that the API consumer can use. For example, `fadeTo()` and `flash()` might be functions for lights. `setHumidityLevel` might be a function for dehumidifiers.\n- Each device type should be structured as a plugin, so that the consumer can add their own / write custom plugins if they want.\n- Ideally, the device type / schema would be autodiscovered. If that's not possible, it should be easy for the consumer to specify the device type.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuyaapi%2Flocal-control-api-ideas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuyaapi%2Flocal-control-api-ideas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuyaapi%2Flocal-control-api-ideas/lists"}