diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2022-04-07 19:37:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 19:37:41 +0300 |
commit | 67529eb8d51deb8779b6ae994efbad0c3d51a57d (patch) | |
tree | ffb315107cb398ac92a6f044caada48e80fe49ce | |
parent | 9d6bae6d583365c87638c233f02dd428e0d02a5e (diff) |
Update README.md
-rw-r--r-- | README.md | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -242,6 +242,18 @@ Then obtain local key: await dev.RefreshLocalKeyAsync() ``` +## Using the Cloud API +You can use official [Tuya Cloud API](https://developer.tuya.com/en/docs/cloud/). + +```C# +Example of [device specifications](https://developer.tuya.com/en/docs/cloud/device-control?id=K95zu01ksols7#title-27-Get%20the%20specifications%20and%20properties%20of%20the%20device%2C%20including%20the%20instruction%20set%20and%20status%20set) request: + +var api = new TuyaApi(region: TuyaApi.Region.CentralEurope, accessId: ACCESS_ID, apiSecret: API_SECRET); +var devspec = await api.RequestAsync(TuyaApi.Method.GET, $"/v1.1/devices/{DEVICE_ID}/specifications"); +``` + +`devspec` will contain JSON with all device data points with descriptions and possible values. + ## Credits * TinyTuya https://github.com/jasonacox/tinytuya by Jason Cox For Python version of the library inspired me |