Skip to main content

Tuya Device Sharing SDK

A Python sdk for Tuya Open API, which provides basic IoT capabilities like device management capabilities, helping you create IoT solutions. With diversified devices and industries, Tuya IoT Development Platform opens basic IoT capabilities like device management, AI scenarios, and data analytics services, as well as industry capabilities, helping you create IoT solutions.

Features

APIs

  • Manager
    • update_device_cache
    • refresh_mq
    • send_commands
    • get_device_stream_allocate
    • query_scenes
    • trigger_scene
    • add_device_listener
    • remove_device_listener
    • unload
  • CustomerApi
    • get
    • post
    • put
    • delete
  • SharingMQ
    • start
    • stop
    • add_message_listener
    • remove_message_listener
  • DeviceRepository
    • query_devices_by_home
    • query_devices_by_ids
    • send_commands
  • HomeRepository
    • query_homes
    • query_room_by_device
  • SceneRepository
    • query_scenes
    • trigger_scene

Possible scenarios

Usage

Release Note

version Description
0.1.8 fix topic error
0.1.9 fix mq link id
0.2.0 MQTT bulk subscription
0.2.1 add updated_status_properties to SharingDeviceListener
0.2.2 add timestamp to SharingDeviceListener
0.2.3 fix paho-mqtt dependency
0.2.4 fix asbtract decorator
0.2.5 handle unknown dpid in_on_device_report #39
0.2.6 Cancel MQTT reconnect on stop #37
0.2.8 Add report_type to device status #51
0.2.9 Fix incorrect type hint in DeviceFunction #44
Add pre-commit workflow #46
Apply ruff format #47
0.2.10 Make enum mapping lookups case-insensitive #55
Add ruff-check to pre-commit #56
Add ApiRequestException for failed API responses #58
Fix 0.2.9 changelog formatting #59
0.2.11 Add query_room_by_device to query the room a device belongs to
0.2.12 Add custom code type validation to disable local reporting when custom-type is enabled #68
0.2.13 Fix query_room_by_device to use the terminal API path /v1.0/m/thing/ha/{device_id}/room
Skip AES-GCM decrypt when response result is empty (e.g. device without a room)
0.2.14 Fix MQTT stale client_id reconnect storm on renewal: fully tear down the old client (loop_stop) and disable paho auto-reconnect so it never re-authenticates with an expired client_id

Installation

pip3 install tuya-device-sharing-sdk

Issue feedback

You can provide feedback on your issue via Github Issue.

License

tuya-device-sharing-sdk is available under the MIT license. Please see the LICENSE file for more info.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tuya_device_sharing_sdk-0.2.14.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuya_device_sharing_sdk-0.2.14-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file tuya_device_sharing_sdk-0.2.14.tar.gz.

File metadata

  • Download URL: tuya_device_sharing_sdk-0.2.14.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for tuya_device_sharing_sdk-0.2.14.tar.gz
Algorithm Hash digest
SHA256 0072ddd4ddc4ce8f023b493f3a72d40b85247baf0d6ca48c9d88f230e79255df
MD5 8b0cb3cf3f2bca779ae7b5a91c6436c1
BLAKE2b-256 b8a92a754d6423f09658dd10cd1834e2a67f02f661138c45b0fa66ad54858590

See more details on using hashes here.

File details

Details for the file tuya_device_sharing_sdk-0.2.14-py3-none-any.whl.

File metadata

File hashes

Hashes for tuya_device_sharing_sdk-0.2.14-py3-none-any.whl
Algorithm Hash digest
SHA256 8f600fb7ecff546e6a18878d70791ac3aa9c3fa5bbb41f04b2a6172a1c465bb5
MD5 619b6c422cc0efe42c4d15e186d54233
BLAKE2b-256 a7f07be6730e71348c6e6075d5b177b535508bfdada906d0c7c065c99e56fb42

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.15

2 files

This release

0.2.14 This release

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

1 file

0.2.8

1 file

0.2.7

1 file

0.2.6

1 file

0.2.5

1 file

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page