Real Hikvision/Dahua camera driver; gate Backend-push-IP on capability

Replace the camera stub with HttpCamera: Hikvision ISAPI and Dahua CGI
snapshots over client-side HTTP Digest (new drivers/http-digest.ts).
healthCheck() now pulls a real frame instead of returning ready/stub.
Snapshot carries bytes (driver fetches); storage/imageRef is the caller's
job, keeping the adapter free of storage deps.

Fix the cosmetic Backend-push-IP field: add pushesToBackend to DeviceDriver
(only Dingtian sets it), expose as pushCapable in the catalog, and gate the
wizard's backend-IP fetch + field on it so pull-only devices hide it.

Verified on hardware (Hikvision 10.0.10.121): healthCheck ready,
captureSnapshot returns a valid JPEG.
This commit is contained in:
2026-06-15 16:17:49 +02:00
parent 59bfe2013f
commit fa65b2df86
10 changed files with 343 additions and 34 deletions
+12
View File
@@ -42,6 +42,13 @@ export interface DeviceDriver<T extends Device = Device> {
/** Transports/notes surfaced in the UI, e.g. ["tcp-ip"], ["wiegand"]. */
readonly transports: readonly string[];
readonly configFields: readonly ConfigField[];
/**
* True if the device calls BACK to our backend (HTTP push) and therefore needs
* a backend IP configured at assign time. Pull-only devices (cameras poll a
* snapshot, the relay is commanded) leave this false so the setup wizard hides
* the "Backend push IP" field. See wiki/concepts/device-input-flow.md.
*/
readonly pushesToBackend?: boolean;
/** Build a live adapter instance from validated config. */
create(config: DeviceConfig): T;
}
@@ -130,6 +137,11 @@ class DeviceRegistry {
}
return byCategory;
}
/** Driver ids that push to the backend (need a backend IP at assign time). */
pushCapable(): string[] {
return [...this.#drivers.values()].filter((d) => d.pushesToBackend).map((d) => d.id);
}
}
export interface CatalogEntry {