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
0.2.15 Parse electricity meter frames V0/V1/V2 into six parameters (voltage / current / power / reactive power / apparent power / power factor)

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.

Metadata

Release files for tuya-device-sharing-sdk 0.2.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tuya-device-sharing-sdk 0.2.15
File Size Uploaded Provenance
tuya_device_sharing_sdk-0.2.15.tar.gz 27.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tuya-device-sharing-sdk 0.2.15
File Interpreter ABI Platform
tuya_device_sharing_sdk-0.2.15-py3-none-any.whl Python 3 none any Details

Total release size: 68.6 kB

Release files / tuya_device_sharing_sdk-0.2.15.tar.gz

Download URL tuya_device_sharing_sdk-0.2.15.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
360e29e95b63019ba179b8b9b43530fd4f02647ec41deaedd735b753d7877041
BLAKE2b-256 checksum
How to use checksums
4fed1b29b857830d31ade134d3cb733c2a1555a5a919c897b5c32aa5737fc014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / tuya_device_sharing_sdk-0.2.15-py3-none-any.whl

Download URL tuya_device_sharing_sdk-0.2.15-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
415ef070c7b6059f9df97b0f89462d5834af99115f2c6a548c888658cf23e420
BLAKE2b-256 checksum
How to use checksums
2616dcbe536c14875f753c783b1806bd47de2d27c8a13c422d73b400616d6965
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Security for tuya-device-sharing-sdk 0.2.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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