Skip to content

Add TypeScript Homebridge v2 platform plugin for Baytech RPC3 that wraps existing Python scripts#2

Open
pponce wants to merge 1 commit into
masterfrom
codex/create-standalone-homebridge-2.0-plugin
Open

Add TypeScript Homebridge v2 platform plugin for Baytech RPC3 that wraps existing Python scripts#2
pponce wants to merge 1 commit into
masterfrom
codex/create-standalone-homebridge-2.0-plugin

Conversation

@pponce
Copy link
Copy Markdown
Owner

@pponce pponce commented May 15, 2026

Motivation

  • Provide a native Homebridge 2.0 dynamic platform that reuses the existing Python RPC3 scripts while exposing outlets and reboot switches to HomeKit.
  • Avoid concurrent telnet operations by serializing script calls and reduce RPC3 load via per-outlet caching and configurable polling.
  • Consolidate repository into an npm-installable plugin with build scripts and TypeScript sources.

Description

  • Add a new TypeScript Homebridge plugin (src/index.ts, src/platform.ts, src/rpc3-client.ts, src/settings.ts) that registers the RPC3Control dynamic platform and manages Outlet and Switch accessories.
  • Implement Rpc3Client which calls the existing Python scripts via child_process.execFile to run control.py and state.py, and a queue (enqueue) to serialize all script invocations.
  • Implement per-outlet state caching with TTL and periodic refresh via a configurable pollIntervalMs, and stateless reboot switches that auto-reset after issuing a reboot command.
  • Add project metadata and build configuration (package.json, tsconfig.json), update documentation (README) with plugin usage and configuration examples, and introduce a .gitignore for common artifacts.

Testing

  • Ran the TypeScript build with npm run build to compile src into dist and the build completed successfully.
  • No automated unit tests were included in this change set.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant