Skip to content

Releases: 3735943886/tuyawizard

v0.1.10

Choose a tag to compare

@3735943886 3735943886 released this 04 Jul 11:44
5894e4d

Bugfix release

Fixed

  • The module-level wizard() convenience function now tears down its TuyaWizard via the context manager (close() on both normal and exception exit). Previously from tuyawizard import wizard; wizard(...) leaked SDK-side state — the requests.Session connection pools and the optional SharingMQ background thread — on every call. The TuyaWizard class already had close()/context-manager teardown; this closes the asymmetry on the front-door function.

Added

  • Memory-leak regression tests: repeatedly constructing + closing a TuyaWizard no longer accumulates threads, un-closed sessions, or live wizard/Manager objects across cycles. The tuya_sharing SDK is never contacted — Manager/LoginControl are mocked.
  • Tests CI workflow running the suite on push/PR across Python 3.9–3.13.

Notes

  • Released now that the bundled Windows EXE's rustuya dependency has reached its 0.3.0 stable line.

v0.1.9

Choose a tag to compare

@3735943886 3735943886 released this 04 Jun 06:15
2b02ff3

Regression fix: close() no longer revokes the cloud terminal by default

0.1.8 regression: close() unconditionally called Manager.unload(), which POSTs to Tuya's /v1.0/m/token/terminal/expire endpoint and invalidates the saved access+refresh tokens server-side. Long-running consumers (rustuya-manager) that reuse tuyacreds.json across calls were forced into the QR fallback on every invocation after the first.

Fix

close() gains a keyword-only revoke_terminal=False parameter. The default no longer calls Manager.unload(); local cleanup (MQ thread join, requests.Session.close(), ref-cycle break) is unchanged so the 0.1.8 memory-leak fix is preserved.

# Long-running service / CLI cred-reuser — DEFAULT, saved creds stay valid
with TuyaWizard() as tuya:
    tuya.login_auto(user_code="...")
    devices = tuya.fetch_devices()

# Explicit logout — revoke server-side tokens
tuya.close(revoke_terminal=True)

__exit__ still calls close() with no args, so with TuyaWizard() defaults to non-revoking.

Downstream

Consumers of 0.1.8 that called close() (or used with) and observed forced QR re-scans should bump to tuyawizard>=0.1.9. No code changes needed beyond the pin bump — default behavior automatically becomes non-revoking.

v0.1.8

Choose a tag to compare

@3735943886 3735943886 released this 01 Jun 02:28
8f9b0b1

close() / context manager for deterministic teardown

Long-running consumers that build a fresh TuyaWizard per operation were leaking ~750-950 KB RSS per cycle (observed by rustuya-manager). The underlying tuya_sharing SDK's Manager.unload() doesn't close the requests.Session connection pool or stop the optional SharingMQ background thread.

Use the context-manager form for leak-free teardown:

from tuyawizard import TuyaWizard

with TuyaWizard() as tuya:
    tuya.login_auto(user_code="YOUR_USER_CODE")
    devices = tuya.fetch_devices()

Or call close() explicitly in a finally block. Idempotent and safe before login_auto(). Existing callers that drop TuyaWizard without close() keep working — the leak just isn't fixed for them.

Downstream consumers should pin tuyawizard>=0.1.8 to use it.

Windows EXE now built from this repo

The Windows single-file tuyawizard.exe is now built directly from this repo and attached to each release. The previous tuyawizard_windows repo has been merged in and archived.

Docs

  • New "Lifecycle and cleanup" section in README.
  • pipx inject instructions for rustuya and cryptography.
  • Note that cryptography is an undeclared transitive dependency of tuya-device-sharing-sdk.

v0.1.7

Choose a tag to compare

@3735943886 3735943886 released this 18 May 23:35
5e68800

Bug Fix

  • fix(auth): Preserve the stored user_code from tuyacreds.json as a fallback for QR re-login. Previously, when the cached access token expired, the wizard would fail with No User Code provided. even though the value was present in the credentials file. QR re-login now works correctly on token expiry.

Maintenance

  • Dependabot bumped GitHub Actions to their latest majors (checkout@v6, setup-python@v6, upload-artifact@v7, download-artifact@v8), clearing the Node.js 20 deprecation warnings.

Full Changelog: v0.1.6...v0.1.7

v0.1.6

Choose a tag to compare

@3735943886 3735943886 released this 18 May 23:22
d0cdba3

What's Changed

  • feat: Expose apply_scan_results so you can inject scan data without rustuya (e.g. via rustuya-bridge).
  • refactor: postprocess_devices now rejects unknown modes with ValueError and warns when scan_results are passed alongside mode="parent" (they would otherwise be silently ignored).
  • docs: Added a "Using as a Python Module" section. Dropped emojis from README headings.
  • ci: Added PyPI release workflow (this release should publish automatically).

Full Changelog: v0.1.5...v0.1.6

v0.1.5

Choose a tag to compare

@3735943886 3735943886 released this 06 Mar 02:23
v0.1.5

v0.1.4

Choose a tag to compare

@3735943886 3735943886 released this 03 Jan 08:46
d86afd4
v0.1.4

v0.1.3

Choose a tag to compare

@3735943886 3735943886 released this 03 Jan 06:20
79d3fbd
v0.1.3

v0.1.2

Choose a tag to compare

@3735943886 3735943886 released this 02 Dec 12:04
e2ecb31
Minor tuning