homebridge-eufy-security / plugin

Homebridge plugin to control certain Eufy Security devices
Apache License 2.0
173 stars 23 forks source link

Prepare for Homebridge v2 integration #604

Closed lenoxys closed 3 months ago

lenoxys commented 3 months ago

This pull request includes several updates to prepare the plugin for integration with Homebridge v2:

  1. Updated .github/workflows/publish_release.yml:

    • Added npm run prebuild step to ensure proper build process for v2 compatibility
  2. Modified .gitignore:

    • Removed .github/workflows/ from ignored files to ensure workflow files are properly tracked
  3. Updated default config values:

    • Added name: 'EufySecurity' to default configuration in both:
      • src/configui/app/util/default-config-values.ts
      • src/plugin/config.ts
    • This change ensures compliance with Homebridge v2 config structure requirements
  4. Removed deprecated event listeners:

    • Removed APIEvent.SHUTDOWN listener in BaseAccessory
    • Removed APIEvent.SHUTDOWN listener in StreamingDelegate
    • These changes align with Homebridge v2's updated lifecycle management
  5. Updated plugin registration in src/plugin/index.ts:

    • Changed from api.registerPlatform(PLATFORM_NAME, EufySecurityPlatform) to api.registerPlatform(PLUGIN_NAME, PLATFORM_NAME, EufySecurityPlatform)
    • This update ensures proper plugin registration format for Homebridge v2
  6. Refactored platform.ts:

    • Updated config property type and initialization to match Homebridge v2 expectations

These changes collectively prepare the plugin for seamless integration with Homebridge v2, ensuring compatibility with the new version's architecture and requirements. The updates address configuration structure, event handling, and plugin registration to align with Homebridge v2 standards.