jasonacox / tinytuya

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

Normalize snapshot.json fields and add "version" to devices.json #262

Closed uzlonewolf closed 1 year ago

uzlonewolf commented 1 year ago

Snapshot saving should now be done through tinytuya.scanner.save_snapshotfile(). This function normalizes all the field names and value types before saving. To load, call tinytuya.scanner.load_snapshotfile() to convert back.

I went with "ver" and "id" in snapshot.json as that's what older versions used. When loaded, "ver" gets replaced with "version" and "id" is copied into "gwId"

uzlonewolf commented 1 year ago

Sigh. I though I tested everything for sure before submitting this. Python 2 and 3, wizard and scan, with and without -force. Of course I totally forgot about snapshot. Again. >_>

Thanks for the fix, it was a copypasta error.