jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
923 stars 165 forks source link

Cloud device list and Content-Type update #324

Closed uzlonewolf closed 1 year ago

uzlonewolf commented 1 year ago

Changes:

The Content-type: application/json header is now always added (can be disabled by setting _tuyaplatform( ..., content_type=None )

If apiDeviceID is provided, the old device list fetching routine is used by default. Leave apiDeviceID empty or set cloud.use_old_device_list = False to use the new routine.

apiDeviceID can now be a comma-separated list of device IDs and it uses all of them to build a list of UIDs.

The cloud init function now ignores any extra/unknown arguments, so you can have extra fields in tinytuya.json and tinytuya.Cloud( **config ) will still work.

Fixes #323

jasonacox commented 1 year ago

Thanks @uzlonewolf ! I'll push this as v1.12.3.