Skip to content

v3.0.0-beta.8

Pre-release
Pre-release

Choose a tag to compare

@tassy-h tassy-h released this 09 Jun 14:52
· 7 commits to beta-3.0.0 since this release

Refactor Configuration Handling, Platform Structure, Logging, Tests, and Various Fixes

1. Major Cleanup Around Configuration Handling

  • Renamed config.options → config.cloud to clarify meaning.
  • Clarified distinction between mode and datasource
    → Introduced Enums for both to improve type safety.
  • Added a dedicated ConfigMigrator class to separate migration logic and clarify responsibilities.
  • Added logic to ignore empty configuration entries, addressing the Homebridge UI issue where empty objects are generated automatically.

2. Refactoring of the Platform Structure

  • Fully reorganized platform.ts, making branching for cloud / local / both modes clearer.
  • Reworked inheritance structure of DeviceManager:
    • Introduced dedicated managers for cloud / local / hybrid.
    • Moved mode‑specific logic into each class to improve separation of concerns.
  • Renamed directory accessories → accessory for consistency.

3. Logging Improvements

  • Sensitive information is no longer logged unless running in debug mode.
  • Standardized how loggers are passed around:
    → Now using logger() to generate a PrefixLogger.
  • Removed logic that generated hash files inside the plugin.

4. Extensive Test Updates

  • Updated many test files to match the refactored structure
    (ConfigMigrator, Logger, each DeviceManager, each Accessory, etc.).
  • Migrated Jest configuration from js → ts.

5. Bug Fixes

  • Fixed inconsistencies in syncDeviceAndAccessory, preventing mismatches between cached accessories and device data.
  • Various fixes for TuyaOpenAPI / TuyaOpenMQ:
    • Unified logging behavior
    • Corrected error response formats
    • Strengthened typing for cryptographic operations (e.g., Uint8Array)

6. Dependency Updates

  • Added lodash and uuid.
  • Updated type definitions such as @types/node.
  • Updated Homebridge peerDependencies to stable versions (removed beta).

7. Miscellaneous Cleanup

  • Removed tuya-local-configs from .gitignore
    → No longer generating hash files.
  • Removed many unnecessary eslint-disable comments across the project.