@camstack/addon-provider-hikvision 1.2.77 → 1.2.78
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/dist/addon.js +91 -1
- package/dist/addon.mjs +91 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -6,7 +6,7 @@ let node_crypto = require("node:crypto");
|
|
|
6
6
|
let node_http = require("node:http");
|
|
7
7
|
let node_https = require("node:https");
|
|
8
8
|
let node_os = require("node:os");
|
|
9
|
-
//#region ../types/dist/event-category-
|
|
9
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
10
10
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
11
11
|
EventCategory["SystemBoot"] = "system.boot";
|
|
12
12
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -378,6 +378,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
378
378
|
*/
|
|
379
379
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
380
380
|
/**
|
|
381
|
+
* Cap event fired by every device that registers the `network-link`
|
|
382
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
383
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
384
|
+
* reading that moved.
|
|
385
|
+
*/
|
|
386
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
387
|
+
/**
|
|
381
388
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
382
389
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
383
390
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -24160,6 +24167,88 @@ onStatusChanged: { data: object({
|
|
|
24160
24167
|
volatileStateFields: ["lastUpdated"]
|
|
24161
24168
|
};
|
|
24162
24169
|
/**
|
|
24170
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
24171
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
24172
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
24173
|
+
* one Home Assistant projection.
|
|
24174
|
+
*/
|
|
24175
|
+
var NetworkLinkStatusSchema = object({
|
|
24176
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
24177
|
+
type: _enum([
|
|
24178
|
+
"wifi",
|
|
24179
|
+
"ethernet",
|
|
24180
|
+
"cellular",
|
|
24181
|
+
"unknown"
|
|
24182
|
+
]),
|
|
24183
|
+
/**
|
|
24184
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
24185
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
24186
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
24187
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
24188
|
+
* SKIP a null rather than coerce it.
|
|
24189
|
+
*/
|
|
24190
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
24191
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
24192
|
+
rssiDbm: number().optional(),
|
|
24193
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
24194
|
+
ssid: string().optional(),
|
|
24195
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
24196
|
+
lastUpdated: number()
|
|
24197
|
+
});
|
|
24198
|
+
var networkLinkCapability = {
|
|
24199
|
+
name: "network-link",
|
|
24200
|
+
scope: "device",
|
|
24201
|
+
deviceNative: true,
|
|
24202
|
+
mode: "singleton",
|
|
24203
|
+
deviceTypes: [
|
|
24204
|
+
DeviceType.Camera,
|
|
24205
|
+
DeviceType.Sensor,
|
|
24206
|
+
DeviceType.Button,
|
|
24207
|
+
DeviceType.Switch,
|
|
24208
|
+
DeviceType.Light,
|
|
24209
|
+
DeviceType.Lock,
|
|
24210
|
+
DeviceType.Siren
|
|
24211
|
+
],
|
|
24212
|
+
methods: {},
|
|
24213
|
+
events: {
|
|
24214
|
+
/**
|
|
24215
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
24216
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
24217
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
24218
|
+
*/
|
|
24219
|
+
onStatusChanged: { data: object({
|
|
24220
|
+
deviceId: number(),
|
|
24221
|
+
status: NetworkLinkStatusSchema
|
|
24222
|
+
}) } },
|
|
24223
|
+
status: {
|
|
24224
|
+
schema: NetworkLinkStatusSchema,
|
|
24225
|
+
kind: "push",
|
|
24226
|
+
empty: {
|
|
24227
|
+
type: "unknown",
|
|
24228
|
+
signalPercent: null,
|
|
24229
|
+
lastUpdated: 0
|
|
24230
|
+
}
|
|
24231
|
+
},
|
|
24232
|
+
/**
|
|
24233
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
24234
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
24235
|
+
* Home Assistant projector regardless of the driver.
|
|
24236
|
+
*/
|
|
24237
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
24238
|
+
/**
|
|
24239
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
24240
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
24241
|
+
* restored slice is what the badge shows until the next read.
|
|
24242
|
+
*
|
|
24243
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
24244
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
24245
|
+
*/
|
|
24246
|
+
durability: "restored",
|
|
24247
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
24248
|
+
* whether persisting is worth a SQLite commit. */
|
|
24249
|
+
volatileStateFields: ["lastUpdated"]
|
|
24250
|
+
};
|
|
24251
|
+
/**
|
|
24163
24252
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
24164
24253
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
24165
24254
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32890,6 +32979,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32890
32979
|
motionTrigger: motionTriggerCapability,
|
|
32891
32980
|
motionZones: motionZonesCapability,
|
|
32892
32981
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32982
|
+
networkLink: networkLinkCapability,
|
|
32893
32983
|
notifier: notifierCapability,
|
|
32894
32984
|
numericSensor: numericSensorCapability,
|
|
32895
32985
|
petFeeder: petFeederCapability,
|
package/dist/addon.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
|
|
|
7
7
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
8
8
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
9
9
|
//#endregion
|
|
10
|
-
//#region ../types/dist/event-category-
|
|
10
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
11
11
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
12
12
|
EventCategory["SystemBoot"] = "system.boot";
|
|
13
13
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -379,6 +379,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
379
379
|
*/
|
|
380
380
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
381
381
|
/**
|
|
382
|
+
* Cap event fired by every device that registers the `network-link`
|
|
383
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
384
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
385
|
+
* reading that moved.
|
|
386
|
+
*/
|
|
387
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
388
|
+
/**
|
|
382
389
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
383
390
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
384
391
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -24161,6 +24168,88 @@ onStatusChanged: { data: object({
|
|
|
24161
24168
|
volatileStateFields: ["lastUpdated"]
|
|
24162
24169
|
};
|
|
24163
24170
|
/**
|
|
24171
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
24172
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
24173
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
24174
|
+
* one Home Assistant projection.
|
|
24175
|
+
*/
|
|
24176
|
+
var NetworkLinkStatusSchema = object({
|
|
24177
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
24178
|
+
type: _enum([
|
|
24179
|
+
"wifi",
|
|
24180
|
+
"ethernet",
|
|
24181
|
+
"cellular",
|
|
24182
|
+
"unknown"
|
|
24183
|
+
]),
|
|
24184
|
+
/**
|
|
24185
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
24186
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
24187
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
24188
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
24189
|
+
* SKIP a null rather than coerce it.
|
|
24190
|
+
*/
|
|
24191
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
24192
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
24193
|
+
rssiDbm: number().optional(),
|
|
24194
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
24195
|
+
ssid: string().optional(),
|
|
24196
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
24197
|
+
lastUpdated: number()
|
|
24198
|
+
});
|
|
24199
|
+
var networkLinkCapability = {
|
|
24200
|
+
name: "network-link",
|
|
24201
|
+
scope: "device",
|
|
24202
|
+
deviceNative: true,
|
|
24203
|
+
mode: "singleton",
|
|
24204
|
+
deviceTypes: [
|
|
24205
|
+
DeviceType.Camera,
|
|
24206
|
+
DeviceType.Sensor,
|
|
24207
|
+
DeviceType.Button,
|
|
24208
|
+
DeviceType.Switch,
|
|
24209
|
+
DeviceType.Light,
|
|
24210
|
+
DeviceType.Lock,
|
|
24211
|
+
DeviceType.Siren
|
|
24212
|
+
],
|
|
24213
|
+
methods: {},
|
|
24214
|
+
events: {
|
|
24215
|
+
/**
|
|
24216
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
24217
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
24218
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
24219
|
+
*/
|
|
24220
|
+
onStatusChanged: { data: object({
|
|
24221
|
+
deviceId: number(),
|
|
24222
|
+
status: NetworkLinkStatusSchema
|
|
24223
|
+
}) } },
|
|
24224
|
+
status: {
|
|
24225
|
+
schema: NetworkLinkStatusSchema,
|
|
24226
|
+
kind: "push",
|
|
24227
|
+
empty: {
|
|
24228
|
+
type: "unknown",
|
|
24229
|
+
signalPercent: null,
|
|
24230
|
+
lastUpdated: 0
|
|
24231
|
+
}
|
|
24232
|
+
},
|
|
24233
|
+
/**
|
|
24234
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
24235
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
24236
|
+
* Home Assistant projector regardless of the driver.
|
|
24237
|
+
*/
|
|
24238
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
24239
|
+
/**
|
|
24240
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
24241
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
24242
|
+
* restored slice is what the badge shows until the next read.
|
|
24243
|
+
*
|
|
24244
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
24245
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
24246
|
+
*/
|
|
24247
|
+
durability: "restored",
|
|
24248
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
24249
|
+
* whether persisting is worth a SQLite commit. */
|
|
24250
|
+
volatileStateFields: ["lastUpdated"]
|
|
24251
|
+
};
|
|
24252
|
+
/**
|
|
24164
24253
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
24165
24254
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
24166
24255
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -32891,6 +32980,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32891
32980
|
motionTrigger: motionTriggerCapability,
|
|
32892
32981
|
motionZones: motionZonesCapability,
|
|
32893
32982
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32983
|
+
networkLink: networkLinkCapability,
|
|
32894
32984
|
notifier: notifierCapability,
|
|
32895
32985
|
numericSensor: numericSensorCapability,
|
|
32896
32986
|
petFeeder: petFeederCapability,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-hikvision",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.78",
|
|
4
4
|
"description": "Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|