@homebridge-plugins/homebridge-eufy-security 4.6.0-beta.16 → 4.6.0-beta.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/instructions.md +151 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with the homebridge-eufy-security plugin.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Homebridge plugin that exposes Eufy Security devices to Apple HomeKit. Published as `@homebridge-plugins/homebridge-eufy-security` under the `homebridge-plugins` GitHub organization.
|
|
8
|
+
|
|
9
|
+
Depends on `eufy-security-client` (upstream: bropat/eufy-security-client) for cloud API, P2P, push notifications, and MQTT communication.
|
|
10
|
+
|
|
11
|
+
## Build & Dev Commands
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm run build # rimraf dist -> tsc -> copy media/ to dist/
|
|
15
|
+
npm run build-plugin # tsc only (no media copy)
|
|
16
|
+
npm run lint # eslint 'src/**/*.ts' --max-warnings=0
|
|
17
|
+
npm run lint-fix # eslint with --fix
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- Output: `dist/`
|
|
21
|
+
- `--max-warnings=0` is enforced -- all warnings must be fixed before committing
|
|
22
|
+
- `@typescript-eslint/no-explicit-any` is globally disabled; do not add eslint-disable comments for it
|
|
23
|
+
- Run `npm run lint` and `npm run build` before pushing
|
|
24
|
+
|
|
25
|
+
## Architecture
|
|
26
|
+
|
|
27
|
+
Entry point `src/index.ts` registers `EufySecurityPlatform` with Homebridge. The platform class (`src/platform.ts`) is the core -- it initializes the `EufySecurity` client, discovers devices, and creates HomeKit accessories.
|
|
28
|
+
|
|
29
|
+
**Accessory classes** in `src/accessories/` map Eufy device types to HomeKit services:
|
|
30
|
+
- `CameraAccessory` -- cameras, doorbells, floodlights (handles streaming delegates)
|
|
31
|
+
- `StationAccessory` -- base stations (security system service for arm/disarm)
|
|
32
|
+
- `LockAccessory`, `EntrySensorAccessory`, `MotionSensorAccessory`, `SmartDropAccessory`
|
|
33
|
+
- `Device.ts` -- base class shared by all accessories
|
|
34
|
+
|
|
35
|
+
**Streaming pipeline** in `src/controller/`:
|
|
36
|
+
- `streamingDelegate.ts` -- HomeKit camera streaming (FFmpeg-based)
|
|
37
|
+
- `recordingDelegate.ts` -- HomeKit Secure Video recording
|
|
38
|
+
- `snapshotDelegate.ts` -- snapshot handling
|
|
39
|
+
- `LocalLivestreamManager.ts` -- manages P2P livestream sessions
|
|
40
|
+
|
|
41
|
+
**Utilities** in `src/utils/`: logging (`utils.ts`), FFmpeg wrapper (`ffmpeg.ts`), two-way audio (`Talkback.ts`).
|
|
42
|
+
|
|
43
|
+
**Plugin UI** in `homebridge-ui/`: `server.js` handles UI server logic and diagnostics generation.
|
|
44
|
+
|
|
45
|
+
### Key source files for device registration and triage
|
|
46
|
+
|
|
47
|
+
- `src/platform.ts` (`register_device`) -- device registration logic; devices can stack multiple capabilities (independent `if` blocks, not `else if`)
|
|
48
|
+
- `src/accessories/BaseAccessory.ts` -- characteristic registration, service pruning
|
|
49
|
+
- `src/accessories/Device.ts` -- sensor/battery service, property helpers
|
|
50
|
+
- `src/accessories/<Type>Accessory.ts` -- device-specific HomeKit mapping
|
|
51
|
+
|
|
52
|
+
## Key Technical Details
|
|
53
|
+
|
|
54
|
+
- ESM project (`"type": "module"`) -- imports use `.js` extensions
|
|
55
|
+
- TypeScript strict mode, ES2022 target
|
|
56
|
+
- Node.js 20, 22, or 24 required
|
|
57
|
+
- Homebridge >=1.9.0 or ^2.0.0-beta
|
|
58
|
+
- Uses `ffmpeg-for-homebridge` for video transcoding
|
|
59
|
+
- `src/version.ts` is auto-generated at prebuild time -- do not edit manually
|
|
60
|
+
|
|
61
|
+
## Git Workflow
|
|
62
|
+
|
|
63
|
+
**IMPORTANT: Create the branch BEFORE editing any files.**
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
# Create dedicated branch from beta before making any changes
|
|
67
|
+
git checkout beta-*.*.* && git pull origin beta-*.*.*
|
|
68
|
+
git checkout -b [fix/feat/chore]/<short-description>
|
|
69
|
+
|
|
70
|
+
# Stage and commit each change individually
|
|
71
|
+
git add <file>
|
|
72
|
+
git commit -m "fix: <concise description of what changed and why>"
|
|
73
|
+
|
|
74
|
+
# Push and create PR
|
|
75
|
+
git push -u origin fix/<short-description>
|
|
76
|
+
gh pr create --base beta-*.*.* --title "<concise title>" --body-file /tmp/pr-body.md
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
- Branch from `beta-*.*.*`, not `master`
|
|
80
|
+
- PR target: `beta-*.*.*`
|
|
81
|
+
- Branch naming: `fix/`, `feat/`, `chore/` prefix
|
|
82
|
+
|
|
83
|
+
### Commit message rules
|
|
84
|
+
|
|
85
|
+
- Single line, no line breaks mid-sentence
|
|
86
|
+
- Describe the **spirit** of the change, not the code diff
|
|
87
|
+
- No Co-Authored-By
|
|
88
|
+
|
|
89
|
+
### PR body
|
|
90
|
+
|
|
91
|
+
- Write to `/tmp/pr-body-<branch>.md` using file creation -- **never** use heredoc (`cat << EOF`) in the terminal (quotes and special characters break it)
|
|
92
|
+
- Describe the **spirit** of the change, not the code diff
|
|
93
|
+
- Concise description of the problem and fix
|
|
94
|
+
- PR body is **not** the release note -- keep it focused on the code change for reviewers
|
|
95
|
+
|
|
96
|
+
### Release notes
|
|
97
|
+
|
|
98
|
+
- Write to `/tmp/release-notes-<version>.md` using file creation
|
|
99
|
+
- **Audience is end users** -- focus on what matters to them: new devices, behaviour changes, removed settings, required actions
|
|
100
|
+
- **Concise, bullet-driven** -- no markdown tables, no verbose paragraphs. Short section intros (1-2 sentences max) followed by bullet lists
|
|
101
|
+
- **No internal milestones** -- don't mention "first GA since X" or beta iteration counts
|
|
102
|
+
- **Structure for a branch** (e.g., `4.4.x`), not a single version
|
|
103
|
+
- **Required actions front and center** -- if users need to change config or upgrade Node.js, say so early and clearly
|
|
104
|
+
- **Tone**: direct, no filler, no emojis
|
|
105
|
+
|
|
106
|
+
### Issue comments
|
|
107
|
+
|
|
108
|
+
- Use `gh issue comment <number> --repo homebridge-plugins/homebridge-eufy-security --body "<message>"`
|
|
109
|
+
- Use first person ("I")
|
|
110
|
+
- Thank the user by @mention
|
|
111
|
+
- Be formal and concise
|
|
112
|
+
- **Audience is end users** -- keep language simple, no internal jargon
|
|
113
|
+
- Don't scope a fix to a specific device when it applies broadly
|
|
114
|
+
- When a fix is merged, check the published beta version (`npm view @homebridge-plugins/homebridge-eufy-security dist-tags`) and mention it in the comment
|
|
115
|
+
|
|
116
|
+
## Dependency Policy -- `eufy-security-client`
|
|
117
|
+
|
|
118
|
+
**CRITICAL:**
|
|
119
|
+
- **`beta-*.*.*` branches** -- use the `dev` dist-tag (`"eufy-security-client": "dev"`)
|
|
120
|
+
- **`master` branch** -- **NEVER** use the `dev` dist-tag. Always use a pinned stable version (e.g. `"^3.7.2"`). Before merging to master, replace `"dev"` with the corresponding stable release version.
|
|
121
|
+
|
|
122
|
+
When updating the `eufy-security-client` version in `package.json`:
|
|
123
|
+
1. Check the upstream changelog and README at https://github.com/bropat/eufy-security-client/blob/master/README.md
|
|
124
|
+
2. Identify breaking changes, new features, or device support changes
|
|
125
|
+
3. Summarize the impact in the PR body
|
|
126
|
+
4. If there are breaking changes, note any required code adjustments
|
|
127
|
+
|
|
128
|
+
## Diagnostic Triage
|
|
129
|
+
|
|
130
|
+
For issue triage using diagnostics archives, see the full triage prompt at `.github/prompts/diag-triage.prompt.md`. Key points:
|
|
131
|
+
|
|
132
|
+
- Diagnostics archives are encrypted (RSA-4096 + AES-256-GCM); decrypt with `node scripts/decrypt-diagnostics.mjs <file>.tar.gz.enc`
|
|
133
|
+
- Always check archive completeness before analysis -- missing runtime logs means the plugin wasn't running
|
|
134
|
+
- Check if debug mode is enabled (`enableDetailedLogging`); if disabled, ask the user to enable it and re-export
|
|
135
|
+
- Narrow down whether the issue is in `homebridge-eufy-security` (accessory registration, HomeKit mapping, config handling) or in `eufy-security-client` (device discovery, property events, P2P, push notifications)
|
|
136
|
+
- If the environment indicates HOOBS: label `hoobs` + `wontfix` and close -- HOOBS is not supported
|
|
137
|
+
|
|
138
|
+
### Label recommendations
|
|
139
|
+
|
|
140
|
+
| Label | When to use |
|
|
141
|
+
|---|---|
|
|
142
|
+
| `depends on eufy-security-client` | Issue originates in bropat's eufy-security-client library |
|
|
143
|
+
| `device-support` | New device type support request |
|
|
144
|
+
| `debug log missing` | Diagnostics lack logs or debug mode was disabled |
|
|
145
|
+
| `configuration issue` | Problem caused by user config |
|
|
146
|
+
| `livestream` | Camera livestream, video feed, P2P, RTSP, streaming failures |
|
|
147
|
+
| `question` | Further information is requested |
|
|
148
|
+
| `resolved in beta` | Fix already in current beta |
|
|
149
|
+
| `needs triage` | New issue awaiting initial analysis |
|
|
150
|
+
| `duplicate` | Issue or PR already exists |
|
|
151
|
+
| `hoobs` | HOOBS-specific -- label as `hoobs` + `wontfix` and close |
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const LIB_VERSION = "4.6.0-beta.
|
|
1
|
+
export const LIB_VERSION = "4.6.0-beta.17";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Homebridge Eufy Security",
|
|
3
3
|
"name": "@homebridge-plugins/homebridge-eufy-security",
|
|
4
|
-
"version": "4.6.0-beta.
|
|
4
|
+
"version": "4.6.0-beta.17",
|
|
5
5
|
"description": "Control Eufy Security from homebridge.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|