@viguza/homebridge-ezviz 2.0.2 → 2.1.0

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/CODE_OF_CONDUCT.md +132 -0
  3. package/CONTRIBUTING.md +70 -0
  4. package/README.md +8 -8
  5. package/SECURITY.md +33 -0
  6. package/dist/accessories/ip-camera.js +6 -2
  7. package/dist/accessories/ip-camera.js.map +1 -1
  8. package/dist/api/ezviz-api.d.ts +13 -4
  9. package/dist/api/ezviz-api.js +155 -73
  10. package/dist/api/ezviz-api.js.map +1 -1
  11. package/dist/api/ezviz-requests.d.ts +3 -0
  12. package/dist/api/ezviz-requests.js +7 -21
  13. package/dist/api/ezviz-requests.js.map +1 -1
  14. package/dist/platform.d.ts +1 -0
  15. package/dist/platform.js +18 -11
  16. package/dist/platform.js.map +1 -1
  17. package/dist/types/data.d.ts +2 -2
  18. package/dist/utils/ffmpeg.d.ts +0 -2
  19. package/dist/utils/ffmpeg.js +6 -22
  20. package/dist/utils/ffmpeg.js.map +1 -1
  21. package/dist/utils/hksv-prebuffer.d.ts +4 -0
  22. package/dist/utils/hksv-prebuffer.js +48 -8
  23. package/dist/utils/hksv-prebuffer.js.map +1 -1
  24. package/dist/utils/hksv-recording-delegate.d.ts +1 -1
  25. package/dist/utils/hksv-recording-delegate.js +22 -12
  26. package/dist/utils/hksv-recording-delegate.js.map +1 -1
  27. package/dist/utils/mp4-parser.js +8 -1
  28. package/dist/utils/mp4-parser.js.map +1 -1
  29. package/dist/utils/rtsp-url.d.ts +5 -0
  30. package/dist/utils/rtsp-url.js +14 -5
  31. package/dist/utils/rtsp-url.js.map +1 -1
  32. package/dist/utils/sanitize.d.ts +5 -0
  33. package/dist/utils/sanitize.js +10 -0
  34. package/dist/utils/sanitize.js.map +1 -0
  35. package/dist/utils/streaming-delegate.js +5 -3
  36. package/dist/utils/streaming-delegate.js.map +1 -1
  37. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -19,6 +19,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
19
  ### Removed
20
20
  - Nothing yet
21
21
 
22
+ ## [2.1.0] - 2026-09-24
23
+
24
+ ### ⚠️ Upgrade notes
25
+ Check your Node.js version before updating (Homebridge UI shows it on the status page). This release requires **Node.js 22 or 24**.
26
+
27
+ ### Removed
28
+ - **Node.js 18 and 20 are no longer supported**, since both have reached end of life. The plugin now requires Node.js 22 or 24, matching Homebridge's own supported versions. If you can't upgrade Node.js yet, stay on 2.0.3
29
+ - Homebridge 2.0 beta versions are no longer listed as supported; use Homebridge 1.8+ or the 2.0 release
30
+
31
+ ## [2.0.3] - 2026-09-24
32
+
33
+ ### Security
34
+ - Camera credentials no longer leak into the Homebridge log. Snapshot timeouts, live-view ffmpeg output (including ffmpeg's own error and banner lines) and ffmpeg start failures printed the full RTSP URL with the camera's username and verification code. They're now masked as `rtsp://***:***@...`, including for verification codes containing characters like `@` or `/`
35
+
36
+ ### Fixed
37
+ - MQTT real-time push still died after the first 12h session refresh: the refreshed credentials dropped the EZVIZ username, so the reconnect added in 2.0.2 was skipped and motion silently fell back to the 30s poll. The username is now kept, and MQTT also reconnects when the session is renewed mid-cycle after EZVIZ rejects it
38
+ - Plug, camera privacy and alarm-mode changes failed with "communication failure" after EZVIZ invalidated the session mid-cycle, until the next 12h refresh. They now renew the session and retry like other requests
39
+ - A session renewal that EZVIZ kept rejecting could produce an endless chain of retry requests
40
+ - HomeKit Secure Video: when two recordings overlapped, closing the first one stopped the wrong ffmpeg process and left the old one running against the camera. This caused "Recording download stream is still awaiting generator" warnings and could use up the camera's RTSP connections, making later snapshots time out. An ffmpeg process that ignored the stop signal also could never be force-stopped
41
+ - HomeKit Secure Video: if the background prebuffer's ffmpeg died (e.g. a WiFi drop or camera reboot), recordings lost their pre-roll until restart and could fail to decode. It now restarts automatically with a clean buffer
42
+ - HomeKit Secure Video: an unexpected error on the prebuffer's local connection could crash Homebridge, and an unusual video stream could make a recording hang silently
43
+ - Verification codes containing special characters (such as `@`, `/` or `#`) produced an invalid RTSP URL
44
+ - Live view crashed for cameras that EZVIZ reports without a switch list
45
+ - A camera that was offline when Homebridge started was left half set up. It now gets a working camera accessory and a log warning explaining that video will work once it's back online and Homebridge is restarted
46
+ - Accounts with more than 30 devices only saw the first 30. Devices past that point were also removed from HomeKit if their position in the list changed
47
+ - Toggling a plug or camera privacy right as a background refresh was running could make HomeKit show the old state for up to a minute
48
+ - An alarm mode reported as `0` (unset) could be misread as another mode
49
+ - Dual-lens cameras made two identical alarm-history requests every 30 seconds instead of one
50
+
22
51
  ## [2.0.2] - 2026-09-24
23
52
 
24
53
  ### Fixed
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported privately to the project maintainer using the contact details on the
63
+ maintainer's GitHub profile ([@viguza](https://github.com/viguza)).
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,70 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve homebridge-ezviz. Bug reports, fixes and new device support are all welcome.
4
+
5
+ ## Reporting bugs and requesting features
6
+
7
+ Open an issue using one of the [issue templates](https://github.com/viguza/homebridge-ezviz/issues/new/choose). For bugs, include:
8
+
9
+ - Plugin, Homebridge and Node.js versions
10
+ - The device model(s) involved
11
+ - Your config with the `password`, `code` and email removed
12
+ - The relevant log lines, ideally with Homebridge debug mode on
13
+
14
+ The plugin masks camera credentials in RTSP URLs, but review logs before posting them anyway.
15
+
16
+ **Security issues:** don't open a public issue. Follow [SECURITY.md](SECURITY.md) instead.
17
+
18
+ ## Development setup
19
+
20
+ Requirements: Node.js 18, 20, 22 or 24, and an EZVIZ account with at least one device if you want to test against real hardware.
21
+
22
+ ```bash
23
+ git clone https://github.com/viguza/homebridge-ezviz.git
24
+ cd homebridge-ezviz
25
+ npm install
26
+ npm run build
27
+ ```
28
+
29
+ Useful scripts:
30
+
31
+ | Command | What it does |
32
+ |---------|--------------|
33
+ | `npm run build` | Compiles TypeScript from `src/` to `dist/` |
34
+ | `npm run lint` | Runs ESLint; warnings fail the check |
35
+ | `npm test` | Runs the Jest test suite |
36
+ | `npm run watch` | Builds, links the plugin, and restarts a local Homebridge on every change in `src/` |
37
+
38
+ `npm run watch` runs Homebridge with the config in `test/hbConfig/`, which is gitignored. Create `test/hbConfig/config.json` with your own platform config to use it. Never commit it.
39
+
40
+ ## Making changes
41
+
42
+ 1. Fork the repository and create a branch from `main`.
43
+ 2. Keep each change focused on one thing. Separate unrelated fixes into separate commits or pull requests.
44
+ 3. Add or update tests for behavior you change. Bug fixes should come with a test that fails without the fix.
45
+ 4. Make sure `npm run lint`, `npm run build` and `npm test` all pass.
46
+ 5. Add a line under `[Unreleased]` in [CHANGELOG.md](CHANGELOG.md) describing the change from a user's point of view.
47
+ 6. Open a pull request and fill in the template.
48
+
49
+ ### Commit messages
50
+
51
+ Commits follow [Conventional Commits](https://www.conventionalcommits.org/) prefixes, for example:
52
+
53
+ ```
54
+ fix: keep username and pushAddr when refreshing the EZVIZ session
55
+ feat: add support for <device>
56
+ refactor: define the HKSV prebuffer length once
57
+ ```
58
+
59
+ Explain *why* in the body when it isn't obvious from the subject.
60
+
61
+ ### Code guidelines
62
+
63
+ - TypeScript, formatted to pass the project's ESLint config.
64
+ - Never log secrets. Anything that can contain an RTSP URL (ffmpeg commands, ffmpeg output, error objects) must go through `redactCredentials()` from `src/utils/sanitize.ts`.
65
+ - Session state (`sessionId`, credentials) is owned by `EZVIZAPI`. Make API calls through its request helpers so 401s renew the session and restart MQTT, rather than calling `axios` directly.
66
+ - Keep HomeKit-blocking reads fast: don't add network retries to requests that HomeKit is waiting on.
67
+
68
+ ## Code of conduct
69
+
70
+ This project follows the [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold it.
package/README.md CHANGED
@@ -31,7 +31,7 @@ A Homebridge plugin for integrating EZVIZ devices into Apple HomeKit. This plugi
31
31
  ## Prerequisites
32
32
 
33
33
  - [Homebridge](https://homebridge.io/) v1.8.0 or higher
34
- - Node.js v18, v20, v22, or v24
34
+ - Node.js v22 or v24
35
35
  - EZVIZ account with registered devices
36
36
  - Network access to your EZVIZ devices
37
37
 
@@ -124,7 +124,7 @@ Add the following to your Homebridge `config.json` file:
124
124
  | `serial` | string | Yes | Camera serial number |
125
125
  | `username` | string | Yes | Camera username (usually "admin") |
126
126
  | `code` | string | Yes | Camera verification code |
127
- | `dualCamera` | boolean | No | Enable for devices with two physical lenses (e.g. H9c) |
127
+ | `dualCamera` | boolean | No | Enable for devices with two physical lenses (e.g. H9c). Each lens gets its own camera accessory; the "Camera Off" (privacy) control applies to the whole device, not a single lens |
128
128
 
129
129
  ### Smart Plug Configuration
130
130
 
@@ -164,6 +164,10 @@ For a complete list of all supported region codes, see [config.schema.json](conf
164
164
  - Check that Video & Picture Encryption is enabled
165
165
  - Verify camera credentials are correct
166
166
  - Check network connectivity
167
+ - If the log warns that EZVIZ reported no local IP address for the camera, it was offline when Homebridge started. Bring it back online and restart Homebridge
168
+
169
+ #### Motion Is Detected Late
170
+ Motion normally arrives in real time over EZVIZ's MQTT push service, with a 30-second poll as a fallback. Look for `MQTT push connected — real-time alerts active` in the log at startup. If it's missing, or the motion log lines show `(poll)` instead of `(MQTT)`, only the fallback is working; enable Debug mode and check the `MQTT` log lines to see why
167
171
 
168
172
  #### Smart Plug Not Responding
169
173
  - Verify the verification code is correct
@@ -191,7 +195,7 @@ Enable debug mode for detailed logging:
191
195
  3. Create a new issue with:
192
196
  - Device information
193
197
  - Configuration (without credentials)
194
- - Error logs
198
+ - Error logs (camera usernames and verification codes in RTSP URLs are masked as `***:***` in the plugin's logs, but still review logs before sharing them)
195
199
  - Steps to reproduce
196
200
 
197
201
  ## API Documentation
@@ -226,11 +230,7 @@ npm test
226
230
 
227
231
  ### Contributing
228
232
 
229
- 1. Fork the repository
230
- 2. Create a feature branch
231
- 3. Make your changes
232
- 4. Add tests if applicable
233
- 5. Submit a pull request
233
+ Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the development setup and pull request process, and [SECURITY.md](SECURITY.md) to report a vulnerability privately. This project follows a [Code of Conduct](CODE_OF_CONDUCT.md).
234
234
 
235
235
  ## Changelog
236
236
 
package/SECURITY.md ADDED
@@ -0,0 +1,33 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ Security fixes are released for the latest published version only. Please update to the [latest release](https://github.com/viguza/homebridge-ezviz/releases/latest) before reporting.
6
+
7
+ | Version | Supported |
8
+ |---------|-----------|
9
+ | 2.x (latest) | Yes |
10
+ | < 2.0 | No |
11
+
12
+ ## Reporting a vulnerability
13
+
14
+ **Please don't report security issues in public issues, discussions or pull requests.**
15
+
16
+ Report them privately through GitHub's private vulnerability reporting:
17
+
18
+ 1. Go to the [Security tab](https://github.com/viguza/homebridge-ezviz/security) of this repository.
19
+ 2. Click **Report a vulnerability**.
20
+ 3. Describe the issue, the affected version, and steps to reproduce it.
21
+
22
+ You should get an initial response within 7 days. Once the issue is confirmed, a fix is released as soon as practical and credited to you in the release notes, unless you'd rather stay anonymous.
23
+
24
+ ## Scope
25
+
26
+ In scope: issues in this plugin's code, for example leaking EZVIZ account or camera credentials (in logs, errors or network traffic), or letting another party control your devices through the plugin.
27
+
28
+ Out of scope: vulnerabilities in EZVIZ's cloud service, apps or device firmware (report those to EZVIZ), and in Homebridge or HAP-NodeJS themselves (report those to the [Homebridge project](https://github.com/homebridge/homebridge)).
29
+
30
+ ## Keeping your setup safe
31
+
32
+ - Treat your Homebridge logs as sensitive. The plugin masks camera credentials, but review logs before sharing them.
33
+ - Don't share your `config.json`: it contains your EZVIZ password and camera verification codes.
@@ -1,9 +1,9 @@
1
1
  import { StreamingDelegate } from '../utils/streaming-delegate.js';
2
2
  import { HksvRecordingDelegate } from '../utils/hksv-recording-delegate.js';
3
- import { getRtspUrl } from '../utils/rtsp-url.js';
3
+ import { HKSV_PREBUFFER_LENGTH_MS } from '../utils/hksv-prebuffer.js';
4
+ import { getCameraLocalIp, getRtspUrl } from '../utils/rtsp-url.js';
4
5
  import { SwitchTypes } from '../utils/enums.js';
5
6
  const STATE_REFRESH_INTERVAL_MS = 60_000;
6
- const HKSV_PREBUFFER_LENGTH_MS = 4000;
7
7
  /**
8
8
  * IP Camera accessory for EZVIZ devices
9
9
  * Handles video streaming and camera functionality
@@ -68,6 +68,10 @@ export class IPCamera {
68
68
  // to recognize it as the recording trigger. CameraMotionSensor drives this service.
69
69
  this.motionService = this.accessory.getService(this.platform.Service.MotionSensor) ||
70
70
  this.accessory.addService(this.platform.Service.MotionSensor);
71
+ if (!getCameraLocalIp(accessory.context.device)) {
72
+ this.platform.log.warn(`${accessory.context.device.Name}: EZVIZ reported no local IP address (camera offline?). ` +
73
+ 'Live view and recording will fail until it is back online and Homebridge is restarted.');
74
+ }
71
75
  const rtspUrl = getRtspUrl(accessory.context.device);
72
76
  // Configure camera controller options
73
77
  const options = {
@@ -1 +1 @@
1
- {"version":3,"file":"ip-camera.js","sourceRoot":"","sources":["../../src/accessories/ip-camera.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,yBAAyB,GAAG,MAAM,CAAC;AACzC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAaA;IACA;IAbX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AC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,6CAA6C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC;QACrH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACjC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC3B,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF"}
@@ -12,6 +12,10 @@ export declare class EZVIZAPI {
12
12
  private log;
13
13
  private deviceListCache;
14
14
  private deviceListInFlight;
15
+ private deviceListGeneration;
16
+ private refreshInFlight;
17
+ private readonly latestAlarmInFlight;
18
+ onSessionRefreshed?: () => void;
15
19
  constructor(config: EZVIZConfig, log?: Logging);
16
20
  /**
17
21
  * Generates a random string of specified length
@@ -26,16 +30,19 @@ export declare class EZVIZAPI {
26
30
  authenticate(): Promise<Credentials | undefined>;
27
31
  /**
28
32
  * Refreshes the session using the refresh token, falling back to full re-authentication
29
- * if the refresh token is missing or rejected.
33
+ * if the refresh token is missing or rejected. Concurrent callers (e.g. several requests
34
+ * hitting 401 at once) share a single refresh.
30
35
  * @returns Promise resolving to updated credentials or undefined on failure
31
36
  */
32
37
  refreshSession(): Promise<Credentials | undefined>;
38
+ private doRefreshSession;
33
39
  /**
34
40
  * Gets the domain URL for the specified region
35
41
  * @param id - The region ID
36
42
  * @returns Promise resolving to the domain URL
37
43
  */
38
44
  getDomain(id: number): Promise<string>;
45
+ private request;
39
46
  /**
40
47
  * Returns the MQTT push address from the server info endpoint.
41
48
  * Used to connect the MQTT client for real-time push notifications.
@@ -50,9 +57,7 @@ export declare class EZVIZAPI {
50
57
  * @returns Promise resolving to device list or undefined if failed
51
58
  */
52
59
  listDevices(forceRefresh?: boolean): Promise<ListDevicesResponse | undefined>;
53
- /**
54
- * Performs the actual device list request and populates the cache
55
- */
60
+ private startDeviceListFetch;
56
61
  private fetchDeviceList;
57
62
  /**
58
63
  * Drops the cached device list so the next read fetches fresh state.
@@ -64,11 +69,15 @@ export declare class EZVIZAPI {
64
69
  * if it has no alarm history. Uses /v3/alarms/v2/advanced, which filters server-side by
65
70
  * deviceSerials — unlike /v3/unifiedmsg/list, which silently ignores that param and
66
71
  * always returns global results.
72
+ *
73
+ * Concurrent calls for the same serial share one request: a dual-lens camera has a
74
+ * motion sensor per lens, both polling the same device on the same schedule.
67
75
  */
68
76
  getLatestAlarm(serialNumber: string): Promise<{
69
77
  time: number;
70
78
  picUrl: string;
71
79
  } | null>;
80
+ private fetchLatestAlarm;
72
81
  /**
73
82
  * Sets the state of a switch/plug
74
83
  * @param serialNumber - The device serial number