@camstack/types 1.2.588 → 1.2.590
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/CHANGELOG.md +13 -0
- package/dist/addon.js +4 -4
- package/dist/addon.mjs +4 -4
- package/dist/capabilities/alarm-panel.cap.d.ts +15 -7
- package/dist/capabilities/battery.cap.d.ts +7 -41
- package/dist/capabilities/capability-definition.d.ts +12 -0
- package/dist/capabilities/index.d.ts +5 -1
- package/dist/capabilities/lock-control.cap.d.ts +5 -2
- package/dist/capabilities/low-power-sleep.cap.d.ts +83 -0
- package/dist/capabilities/resync.cap.d.ts +40 -0
- package/dist/client.js +19 -11
- package/dist/client.mjs +19 -11
- package/dist/{composed-stable-id-BBL71oUQ.mjs → composed-stable-id-BNTaDZEh.mjs} +9 -13
- package/dist/{composed-stable-id-CVbyajE5.js → composed-stable-id-BdeYe5dD.js} +9 -13
- package/dist/device/device-feature-requirements.d.ts +3 -6
- package/dist/device/device-profile.d.ts +1 -1
- package/dist/device/device-type.d.ts +9 -13
- package/dist/device/low-power-sleep.d.ts +19 -0
- package/dist/device/resync-through-adoption.d.ts +12 -0
- package/dist/enums/event-category.d.ts +1 -1
- package/dist/enums.js +1 -1
- package/dist/enums.mjs +1 -1
- package/dist/{event-category-CE_VCE2G.js → event-category-BKxXXxnV.js} +1 -1
- package/dist/{event-category-Hwx_JSCU.mjs → event-category-CY27-fF0.mjs} +1 -1
- package/dist/generated/addon-api.d.ts +113 -8
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/cap-status-types.d.ts +3 -1
- package/dist/generated/cap-vocabulary.d.ts +1 -1
- package/dist/generated/capability-router-map.d.ts +8 -2
- package/dist/generated/device-local-state.d.ts +3 -0
- package/dist/generated/device-proxy.d.ts +5 -0
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/history-catalog.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/generated/runtime-state-durability.d.ts +6 -1
- package/dist/{implemented-methods-ChtdIofW.js → implemented-methods-BarLh7tc.js} +1 -1
- package/dist/{implemented-methods-u7ddjc-_.mjs → implemented-methods-k3KProJd.mjs} +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +357 -82
- package/dist/index.mjs +342 -83
- package/dist/interfaces/event-bus.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/schemas/api-catalog.d.ts +170 -0
- package/dist/{sleep-CsZJsb8n.js → sleep-BA_SIc0O.js} +51 -10
- package/dist/{sleep-D6Pih0Qt.mjs → sleep-BT1bLgPq.mjs} +51 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.590] - 2026-11-17
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- A camera that sleeps now says so through its own capability (low-power-sleep) — a device that only reports a battery is no longer treated as sleeping; Re-sync is offered by the devices that can do it
|
|
15
|
+
|
|
16
|
+
## [1.2.589] - 2026-11-17
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Locks and alarm panels report whether a PIN is needed in one state field, codeRequired (unknown = null); the lock-pin-required / alarm-pin-required device features are gone.
|
|
21
|
+
- New API catalogue schemas (ApiCatalogEntry, ApiCatalogListOutput, ApiCatalogInputSchemaOutput) for the API explorer.
|
|
22
|
+
|
|
10
23
|
## [1.2.588] - 2026-11-17
|
|
11
24
|
|
|
12
25
|
### Changed
|
package/dist/addon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
3
|
-
const require_event_category = require("./event-category-
|
|
4
|
-
const require_composed_stable_id = require("./composed-stable-id-
|
|
2
|
+
const require_sleep = require("./sleep-BA_SIc0O.js");
|
|
3
|
+
const require_event_category = require("./event-category-BKxXXxnV.js");
|
|
4
|
+
const require_composed_stable_id = require("./composed-stable-id-BdeYe5dD.js");
|
|
5
5
|
//#region src/generated/cap-input-defaults.ts
|
|
6
6
|
/**
|
|
7
7
|
* AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
|
|
@@ -34,7 +34,6 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
|
|
|
34
34
|
"pullEncoded": { "maxCount": 8 },
|
|
35
35
|
"pullPcm": { "maxCount": 8 }
|
|
36
36
|
},
|
|
37
|
-
"battery": { "wakeForStream": { "timeoutMs": 8e3 } },
|
|
38
37
|
"control": {
|
|
39
38
|
"next": { "cycle": true },
|
|
40
39
|
"previous": { "cycle": true }
|
|
@@ -92,6 +91,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
|
|
|
92
91
|
"idleStopMinutes": 30
|
|
93
92
|
} } }
|
|
94
93
|
},
|
|
94
|
+
"low-power-sleep": { "wakeUp": { "timeoutMs": 8e3 } },
|
|
95
95
|
"media-player": {
|
|
96
96
|
"channelDown": { "steps": 1 },
|
|
97
97
|
"channelUp": { "steps": 1 },
|
package/dist/addon.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as PipelineStepInputSchema, $n as StoredRecordKindDeclarationSchema, $r as REMOVE_LEAF, A as CAP_ADVANCE_FIELDS, An as clearKnownSecrets, Ar as normalizeAddonInitResult, At as createDebugEmitter, B as describeCustomActions, Bi as RecordNotFoundError, Br as SCOPED_SETTINGS_SCOPES, Ca as makeSecretMarker, Ci as buildSecretRef, Cn as makeInMemoryRecords, Di as normalizeSecretOwner, Dn as REVALIDATE_AFTER_MS, Dr as BaseAddon, Ei as isSecretRef, En as resolveSecretViewsIn, F as isCapMethodAbsent, Fi as ForeignSecretMarkerError, Fn as shortSecretRefHash, G as nodePin, Gi as RevConflictError, Gn as defineEntryKind, Hi as RecordTooLargeError, Hn as DATAPLANE_SECRET_HEADER, Hr as resolveDeviceSettings, I as CALLER_STAMPED_CAPABILITIES, Ii as InvalidRecordError, In as PEER_BYTES_CHUNK_BYTES, Ji as UnknownRecordKindError, Jn as RecordFieldPathSchema, K as readCommandOrigin, Ki as TransactRefusedError, Kn as entryBody, L as withoutCallerStamp, Li as NoCallerError, Ln as PEER_BYTES_MAX_OUTSTANDING, Ma as AddonMigrationsBlockedError, Mi as BatchTooLargeError, Mn as knownSecretCount, N as CAP_STATE_LEAVES, Na as findMigrationsBlocked, Ni as DeclarationRefusedError, Nn as registerKnownSecret, O as HF_REPO, Oi as parseSecretRef, On as createSecretsAccess, P as CAP_METHOD_NOT_IMPLEMENTED, Pi as FilterRequiredError, Pn as scrubKnownSecrets, Q as PipelineRunResultBridge, Qn as RecordRetentionSchema, Qr as secretViewsOf, R as customAction, Ri as PlaintextSecretError, Rn as PEER_BYTES_STALL_MS, Sa as isSecretMarkerLike, Si as arrayItemFieldPath, Sn as ruleFireOfClaim, Sr as ErrorI18nPayloadSchema, St as scopeKey, T as isCommand, Ti as globalSecretScope, Tn as assertTransactScope, Tr as readErrorI18n, Ui as RecordUniqueViolationError, Ur as resolvedValues, Vi as RecordSecretUnavailableError, Vn as CALLER_USERNAME_HEADER, Vr as nodeIdOfScopedKey, W as commandOrigin, Wi as RecordsError, Wn as DisposerChain, X as SWITCH_SETTABLE_GATE, Xi as recordsErrorFromMessage, Xn as RecordKindDeclarationSchema, Y as viewerUiCapability, Yi as asRecordsError, Yn as RecordIndexSchema, Z as switchRefusesSetState, Zn as RecordKindNameSchema, _a as SECRET_CLEAR, _i as RECORD_QUERY_MAX, _t as MODEL_FORMATS, ai as recordSecretRef, ar as isZodSecret, ba as isSecretFieldView, bi as RECORD_SWEEP_INTERVAL_MS, bn as OnBehalfSourceSchema, c as asString, ci as RECORD_BATCH_MAX_BYTES, d as parseJsonUnknown, di as RECORD_DEFAULT_MAX_DATA_BYTES, ei as collectSecretLeaves, er as assertValidDeclaration, et as MIGRATION_API_VERSION, f as hfModelUrl, fi as RECORD_DELETE_BATCH, g as createDeviceProxy, gi as RECORD_MAX_INDEX_FIELDS, h as isDeviceScopedCap, hi as RECORD_MAX_INDEXES, ii as recordSecretCollection, ir as collectZodSecretPaths, it as adminUiCapability, j as CAP_METHOD_TIMEOUTS_MS, jn as forgetKnownSecret, kn as MIN_SCRUBBED_LENGTH, li as RECORD_CLASSES, m as DEVICE_SCOPED_CAPS, mi as RECORD_MAX_DATA_BYTES, ni as parseSecretPath, nr as defineRecordKinds, nt as deviceOpsCapability, o as asJsonObject, oa as createEvent, oi as secretArrayPrefixes, ot as addonPagesSourceCapability, p as BOOT_RECOVERY_BACKOFF_MS, pi as RECORD_ID_MAX_LENGTH, pr as expandCapMethods, q as readNodePin, qi as UnindexedFilterError, qn as EntryDescriptorSchema, r as maskUrlCredentials, ri as recordArrayItemPath, rt as DEVICE_CHILDREN_BATCH_MAX, sa as emitReadiness, si as RECORD_BATCH_MAX, t as sleep, ti as mapSecretLeaves, tr as declarationsOf, ui as RECORD_DATABASES, v as addonSliceHandleApi, va as classifySecretWrite, vi as RECORD_SECRET_COLLECTION_PREFIX, vn as CommandOriginClaimSchema, vt as ReadinessRegistry, wa as toSecretFieldView, wi as formatSecretScope, wn as createRecordsAccess, xa as isSecretMarker, xi as SECRET_REF_SCHEME, xn as RuleFireOriginSchema, y as createEventBusSliceSource, ya as isSecretClear, yi as RECORD_SETTINGS_MAX_ROWS, yn as OnBehalfSchema, yt as ReadinessTimeoutError, z as defineCustomActions, zi as RECORDS_ERROR_CODES, zn as PEER_BYTES_TICKET_TTL_MS } from "./sleep-
|
|
2
|
-
import { t as EventCategory } from "./event-category-
|
|
3
|
-
import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-
|
|
1
|
+
import { $ as PipelineStepInputSchema, $n as StoredRecordKindDeclarationSchema, $r as REMOVE_LEAF, A as CAP_ADVANCE_FIELDS, An as clearKnownSecrets, Ar as normalizeAddonInitResult, At as createDebugEmitter, B as describeCustomActions, Bi as RecordNotFoundError, Br as SCOPED_SETTINGS_SCOPES, Ca as makeSecretMarker, Ci as buildSecretRef, Cn as makeInMemoryRecords, Di as normalizeSecretOwner, Dn as REVALIDATE_AFTER_MS, Dr as BaseAddon, Ei as isSecretRef, En as resolveSecretViewsIn, F as isCapMethodAbsent, Fi as ForeignSecretMarkerError, Fn as shortSecretRefHash, G as nodePin, Gi as RevConflictError, Gn as defineEntryKind, Hi as RecordTooLargeError, Hn as DATAPLANE_SECRET_HEADER, Hr as resolveDeviceSettings, I as CALLER_STAMPED_CAPABILITIES, Ii as InvalidRecordError, In as PEER_BYTES_CHUNK_BYTES, Ji as UnknownRecordKindError, Jn as RecordFieldPathSchema, K as readCommandOrigin, Ki as TransactRefusedError, Kn as entryBody, L as withoutCallerStamp, Li as NoCallerError, Ln as PEER_BYTES_MAX_OUTSTANDING, Ma as AddonMigrationsBlockedError, Mi as BatchTooLargeError, Mn as knownSecretCount, N as CAP_STATE_LEAVES, Na as findMigrationsBlocked, Ni as DeclarationRefusedError, Nn as registerKnownSecret, O as HF_REPO, Oi as parseSecretRef, On as createSecretsAccess, P as CAP_METHOD_NOT_IMPLEMENTED, Pi as FilterRequiredError, Pn as scrubKnownSecrets, Q as PipelineRunResultBridge, Qn as RecordRetentionSchema, Qr as secretViewsOf, R as customAction, Ri as PlaintextSecretError, Rn as PEER_BYTES_STALL_MS, Sa as isSecretMarkerLike, Si as arrayItemFieldPath, Sn as ruleFireOfClaim, Sr as ErrorI18nPayloadSchema, St as scopeKey, T as isCommand, Ti as globalSecretScope, Tn as assertTransactScope, Tr as readErrorI18n, Ui as RecordUniqueViolationError, Ur as resolvedValues, Vi as RecordSecretUnavailableError, Vn as CALLER_USERNAME_HEADER, Vr as nodeIdOfScopedKey, W as commandOrigin, Wi as RecordsError, Wn as DisposerChain, X as SWITCH_SETTABLE_GATE, Xi as recordsErrorFromMessage, Xn as RecordKindDeclarationSchema, Y as viewerUiCapability, Yi as asRecordsError, Yn as RecordIndexSchema, Z as switchRefusesSetState, Zn as RecordKindNameSchema, _a as SECRET_CLEAR, _i as RECORD_QUERY_MAX, _t as MODEL_FORMATS, ai as recordSecretRef, ar as isZodSecret, ba as isSecretFieldView, bi as RECORD_SWEEP_INTERVAL_MS, bn as OnBehalfSourceSchema, c as asString, ci as RECORD_BATCH_MAX_BYTES, d as parseJsonUnknown, di as RECORD_DEFAULT_MAX_DATA_BYTES, ei as collectSecretLeaves, er as assertValidDeclaration, et as MIGRATION_API_VERSION, f as hfModelUrl, fi as RECORD_DELETE_BATCH, g as createDeviceProxy, gi as RECORD_MAX_INDEX_FIELDS, h as isDeviceScopedCap, hi as RECORD_MAX_INDEXES, ii as recordSecretCollection, ir as collectZodSecretPaths, it as adminUiCapability, j as CAP_METHOD_TIMEOUTS_MS, jn as forgetKnownSecret, kn as MIN_SCRUBBED_LENGTH, li as RECORD_CLASSES, m as DEVICE_SCOPED_CAPS, mi as RECORD_MAX_DATA_BYTES, ni as parseSecretPath, nr as defineRecordKinds, nt as deviceOpsCapability, o as asJsonObject, oa as createEvent, oi as secretArrayPrefixes, ot as addonPagesSourceCapability, p as BOOT_RECOVERY_BACKOFF_MS, pi as RECORD_ID_MAX_LENGTH, pr as expandCapMethods, q as readNodePin, qi as UnindexedFilterError, qn as EntryDescriptorSchema, r as maskUrlCredentials, ri as recordArrayItemPath, rt as DEVICE_CHILDREN_BATCH_MAX, sa as emitReadiness, si as RECORD_BATCH_MAX, t as sleep, ti as mapSecretLeaves, tr as declarationsOf, ui as RECORD_DATABASES, v as addonSliceHandleApi, va as classifySecretWrite, vi as RECORD_SECRET_COLLECTION_PREFIX, vn as CommandOriginClaimSchema, vt as ReadinessRegistry, wa as toSecretFieldView, wi as formatSecretScope, wn as createRecordsAccess, xa as isSecretMarker, xi as SECRET_REF_SCHEME, xn as RuleFireOriginSchema, y as createEventBusSliceSource, ya as isSecretClear, yi as RECORD_SETTINGS_MAX_ROWS, yn as OnBehalfSchema, yt as ReadinessTimeoutError, z as defineCustomActions, zi as RECORDS_ERROR_CODES, zn as PEER_BYTES_TICKET_TTL_MS } from "./sleep-BT1bLgPq.mjs";
|
|
2
|
+
import { t as EventCategory } from "./event-category-CY27-fF0.mjs";
|
|
3
|
+
import { a as DeviceType, s as errMsg, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-BNTaDZEh.mjs";
|
|
4
4
|
//#region src/generated/cap-input-defaults.ts
|
|
5
5
|
/**
|
|
6
6
|
* AUTO-GENERATED by scripts/generate-cap-input-defaults.ts — DO NOT EDIT.
|
|
@@ -33,7 +33,6 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
|
|
|
33
33
|
"pullEncoded": { "maxCount": 8 },
|
|
34
34
|
"pullPcm": { "maxCount": 8 }
|
|
35
35
|
},
|
|
36
|
-
"battery": { "wakeForStream": { "timeoutMs": 8e3 } },
|
|
37
36
|
"control": {
|
|
38
37
|
"next": { "cycle": true },
|
|
39
38
|
"previous": { "cycle": true }
|
|
@@ -91,6 +90,7 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
|
|
|
91
90
|
"idleStopMinutes": 30
|
|
92
91
|
} } }
|
|
93
92
|
},
|
|
93
|
+
"low-power-sleep": { "wakeUp": { "timeoutMs": 8e3 } },
|
|
94
94
|
"media-player": {
|
|
95
95
|
"channelDown": { "steps": 1 },
|
|
96
96
|
"channelUp": { "steps": 1 },
|
|
@@ -10,9 +10,8 @@ import { DeviceType } from '../device/device-type.js';
|
|
|
10
10
|
* Many panels require a PIN code on arm / disarm — the optional
|
|
11
11
|
* `code` field on the methods passes it through to the upstream
|
|
12
12
|
* service; it's NEVER persisted in the runtime slice or any event
|
|
13
|
-
* payload.
|
|
14
|
-
* `
|
|
15
|
-
* field without a slice fetch.
|
|
13
|
+
* payload. Whether a code is required is the slice's `codeRequired`
|
|
14
|
+
* (#459): `null` when the provider cannot tell (D393).
|
|
16
15
|
*
|
|
17
16
|
* `availableModes` mirrors HA's `supported_features`-derived arm
|
|
18
17
|
* mode list — the UI renders only the buttons the panel accepts.
|
|
@@ -65,7 +64,7 @@ export declare const AlarmPanelStatusSchema: z.ZodObject<{
|
|
|
65
64
|
night: "night";
|
|
66
65
|
vacation: "vacation";
|
|
67
66
|
}>>;
|
|
68
|
-
|
|
67
|
+
codeRequired: z.ZodNullable<z.ZodBoolean>;
|
|
69
68
|
lastChangedAt: z.ZodNumber;
|
|
70
69
|
}, z.core.$strip>;
|
|
71
70
|
export type AlarmPanelStatus = z.infer<typeof AlarmPanelStatusSchema>;
|
|
@@ -130,7 +129,7 @@ export declare const alarmPanelCapability: {
|
|
|
130
129
|
night: "night";
|
|
131
130
|
vacation: "vacation";
|
|
132
131
|
}>>;
|
|
133
|
-
|
|
132
|
+
codeRequired: z.ZodNullable<z.ZodBoolean>;
|
|
134
133
|
lastChangedAt: z.ZodNumber;
|
|
135
134
|
}, z.core.$strip>;
|
|
136
135
|
readonly kind: 'push';
|
|
@@ -138,7 +137,7 @@ export declare const alarmPanelCapability: {
|
|
|
138
137
|
/**
|
|
139
138
|
* Runtime-state slice — mirrored by the kernel. UI panel reads the
|
|
140
139
|
* full slice; renders an arm button per `availableModes` entry and
|
|
141
|
-
* a PIN field iff `
|
|
140
|
+
* a PIN field iff `codeRequired === true`.
|
|
142
141
|
*/
|
|
143
142
|
readonly runtimeState: z.ZodObject<{
|
|
144
143
|
state: z.ZodEnum<{
|
|
@@ -167,7 +166,7 @@ export declare const alarmPanelCapability: {
|
|
|
167
166
|
night: "night";
|
|
168
167
|
vacation: "vacation";
|
|
169
168
|
}>>;
|
|
170
|
-
|
|
169
|
+
codeRequired: z.ZodNullable<z.ZodBoolean>;
|
|
171
170
|
lastChangedAt: z.ZodNumber;
|
|
172
171
|
}, z.core.$strip>;
|
|
173
172
|
/**
|
|
@@ -177,6 +176,15 @@ export declare const alarmPanelCapability: {
|
|
|
177
176
|
* `scripts/check-runtime-state-durability.ts`.
|
|
178
177
|
*/
|
|
179
178
|
readonly durability: 'restored';
|
|
179
|
+
/**
|
|
180
|
+
* A slice persisted before #459 carries `requiresCode`; the boot seed reads it
|
|
181
|
+
* once into `codeRequired` (`restoredPart`), so no reader meets the old key,
|
|
182
|
+
* and rewrites the row once without it (`seedMirrorFromRow`) — so this entry
|
|
183
|
+
* can be dropped after every node has booted once on a release that has it.
|
|
184
|
+
*/
|
|
185
|
+
readonly restoredFieldRenames: {
|
|
186
|
+
readonly requiresCode: 'codeRequired';
|
|
187
|
+
};
|
|
180
188
|
/**
|
|
181
189
|
* History (D850): the panel's lifecycle state as an `enum` series —
|
|
182
190
|
* change-only, no floor, so an `arming -> pending -> triggered` sequence of a
|
|
@@ -3,9 +3,9 @@ import { type InferProvider } from './capability-definition.js';
|
|
|
3
3
|
import { DeviceType } from '../device/device-type.js';
|
|
4
4
|
import { EventCategory } from '../enums/event-category.js';
|
|
5
5
|
/**
|
|
6
|
-
* Battery status snapshot. Emitted by providers whose device
|
|
7
|
-
* battery
|
|
8
|
-
*
|
|
6
|
+
* Battery status snapshot. Emitted by providers whose device reports a
|
|
7
|
+
* battery (`DeviceFeature.BatteryOperated`): battery cameras, sensors,
|
|
8
|
+
* buttons. Whether the device SLEEPS is `low-power-sleep`, not this cap. Consumers build their own "low
|
|
9
9
|
* battery" alerting on top — the cap deliberately does NOT enforce a
|
|
10
10
|
* threshold.
|
|
11
11
|
*/
|
|
@@ -31,46 +31,12 @@ export declare const batteryCapability: {
|
|
|
31
31
|
readonly deviceNative: true;
|
|
32
32
|
readonly mode: 'singleton';
|
|
33
33
|
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter];
|
|
34
|
-
readonly methods: {
|
|
35
|
-
/**
|
|
36
|
-
* Explicitly wake the camera from low-power sleep ahead of a
|
|
37
|
-
* streaming session start. Consumers that initiate a stream
|
|
38
|
-
* against a sleeping battery cam (HomeKit Secure Video, Alexa
|
|
39
|
-
* RTCSession, snapshot wrappers) call this with a short timeout
|
|
40
|
-
* before establishing the media pipeline — the broker's own
|
|
41
|
-
* passive wake-on-dial works but adds 5–7 seconds to first-frame,
|
|
42
|
-
* during which the consumer renders a black screen. Pre-waking
|
|
43
|
-
* compresses that gap.
|
|
44
|
-
*
|
|
45
|
-
* Returns `awoke: true` when the firmware acknowledged the wake
|
|
46
|
-
* before `timeoutMs`. Returns `awoke: false` when it timed out OR
|
|
47
|
-
* the cap surface is unavailable (no Baichuan / firmware
|
|
48
|
-
* channel); the caller should still attempt the stream — the
|
|
49
|
-
* passive broker wake remains as fallback.
|
|
50
|
-
*/
|
|
51
|
-
readonly wakeForStream: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
52
|
-
deviceId: z.ZodNumber;
|
|
53
|
-
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
54
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
-
awoke: z.ZodBoolean;
|
|
56
|
-
durationMs: z.ZodNumber;
|
|
57
|
-
}, z.core.$strip>, "mutation">;
|
|
58
|
-
};
|
|
59
34
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* … the cap surface is unavailable." (D663).
|
|
35
|
+
* No methods: waking a sleeping camera is `low-power-sleep.wakeUp`
|
|
36
|
+
* (#459, Q2). A battery reading says nothing about sleep — a battery sensor
|
|
37
|
+
* reports charge and never needs waking.
|
|
64
38
|
*/
|
|
65
|
-
readonly
|
|
66
|
-
readonly wakeForStream: {
|
|
67
|
-
readonly kind: 'answer';
|
|
68
|
-
readonly value: {
|
|
69
|
-
readonly awoke: false;
|
|
70
|
-
readonly durationMs: 0;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
};
|
|
39
|
+
readonly methods: {};
|
|
74
40
|
readonly events: {
|
|
75
41
|
/**
|
|
76
42
|
* Emitted whenever the cached status changes (firmware push OR
|
|
@@ -738,6 +738,18 @@ export interface CapabilityDefinition<TName extends string = string, TMethods ex
|
|
|
738
738
|
* `runtimeState` (`scripts/check-runtime-state-durability.ts`).
|
|
739
739
|
*/
|
|
740
740
|
readonly restoredStateFields?: readonly string[];
|
|
741
|
+
/**
|
|
742
|
+
* Renamed runtime-state fields of a `durability: 'restored'` cap, `{ old: new }`.
|
|
743
|
+
* A row persisted before the rename still carries the old key: the boot seed
|
|
744
|
+
* reads it ONCE into the new name (when the new one is absent) and drops it, so
|
|
745
|
+
* no reader ever meets the old key, and the worker that loads the row is handed
|
|
746
|
+
* it under the new name too. The upgraded row is then REWRITTEN once
|
|
747
|
+
* (`seedMirrorFromRow`), so the old key leaves the disk: an entry can be
|
|
748
|
+
* retired after every node has booted once on the release that added it.
|
|
749
|
+
* Requires `durability: 'restored'`; every target must be a field of
|
|
750
|
+
* `runtimeState`.
|
|
751
|
+
*/
|
|
752
|
+
readonly restoredFieldRenames?: Readonly<Record<string, string>>;
|
|
741
753
|
/**
|
|
742
754
|
* Which `runtimeState` fields are recorded as long-term history series
|
|
743
755
|
* (D850), or `'none'`. Mandatory for every cap declaring `runtimeState` —
|
|
@@ -259,6 +259,8 @@ export { type IPtzProvider, type PtzHomePreset, PtzHomePresetSchema, type PtzHom
|
|
|
259
259
|
export { type IPtzAutotrackProvider, type PtzAutotrackRuntimeState, PtzAutotrackRuntimeStateSchema, type PtzAutotrackSettings, PtzAutotrackSettingsSchema, type PtzAutotrackStatus, PtzAutotrackStatusSchema, type PtzAutotrackTargetOption, PtzAutotrackTargetOptionSchema, ptzAutotrackCapability, } from './ptz-autotrack.cap.js';
|
|
260
260
|
export { type IRunningStateProvider, type RunningStateSource, RunningStateSourceSchema, type RunningStateStatus, RunningStateStatusSchema, runningStateCapability, } from './running-state.cap.js';
|
|
261
261
|
export { type IRebootProvider, rebootCapability } from './reboot.cap.js';
|
|
262
|
+
export { type ILowPowerSleepProvider, type LowPowerSleepStatus, LowPowerSleepStatusSchema, lowPowerSleepCapability, } from './low-power-sleep.cap.js';
|
|
263
|
+
export { type IResyncProvider, ResyncDeviceInputSchema, resyncCapability } from './resync.cap.js';
|
|
262
264
|
export { type IRecordingProvider, RECORDING_SOURCE_CAMSTACK, RECORDING_SOURCE_CAMSTACK_ADDON, type RecordingAvailability, RecordingAvailabilitySchema, type RecordingDays, RecordingDaysSchema, type RecordingManifest, RecordingManifestSchema, type RecordingPlayback, RecordingPlaybackSchema, RecordingRangeSchema, type RecordingRead, RecordingReadSchema, type RecordingSource, type RecordingSourceAvailability, RecordingSourceAvailabilitySchema, type RecordingSourceOptions, RecordingSourceOptionsSchema, RecordingSourceSchema, recordingCapability, } from './recording.cap.js';
|
|
263
265
|
export { type IRecordingArchiveProvider, type LocateSegmentResult, LocateSegmentResultSchema, RECORDING_TIMELINE_BATCH_MAX, type ReadGopBytesResult, ReadGopBytesResultSchema, type ReadSegmentBytesResult, ReadSegmentBytesResultSchema, type ReadWindowBytesResult, ReadWindowBytesResultSchema, type RecordingAvailabilityForDevice, RecordingAvailabilityForDeviceSchema, type RecordingDaysForDevice, RecordingDaysForDeviceSchema, type RecordingDeviceUsage, RecordingDeviceUsageSchema, type RecordingLocationUsage, RecordingLocationUsageSchema, type RecordingRebalanceInput, RecordingRebalanceInputSchema, type RecordingRebalanceMove, RecordingRebalanceMoveSchema, type RecordingRebalancePlan, RecordingRebalancePlanSchema, type RecordingRebalanceSkip, type RecordingRebalanceSkipReason, RecordingRebalanceSkipReasonSchema, RecordingRebalanceSkipSchema, type RecordingStatus, RecordingStatusSchema, type RecordingStorageUsage, RecordingStorageUsageSchema, recordingArchiveCapability, } from './recording-archive.cap.js';
|
|
264
266
|
export { type ClipExportFailure, ClipExportFailureSchema, clipExportFailure, clipExportFailureOf, EXPORT_DENSE_MAX_RANGES, type ExportBytes, ExportBytesSchema, type ExportClipSubject, ExportClipSubjectSchema, type ExportDense, type ExportDenseRange, ExportDenseRangeSchema, ExportDenseSchema, type ExportDownload, ExportDownloadSchema, type ExportFootageSubject, ExportFootageSubjectSchema, type ExportOptions, ExportOptionsSchema, type ExportRecord, ExportRecordSchema, ExportSpeedSchema, type ExportState, ExportStateSchema, type ExportSubject, ExportSubjectSchema, ExportTimelapseSchema, exportSubjectOf, type IRecordingExportProvider, RECORDING_EXPORT_MAX_READ_BYTES, recordingExportCapability, resolveCreateExportSubject, resolveExportProfiles, } from './recording-export.cap.js';
|
|
@@ -459,6 +461,8 @@ import type { ptzCapability } from './ptz.cap.js';
|
|
|
459
461
|
import type { ptzAutotrackCapability } from './ptz-autotrack.cap.js';
|
|
460
462
|
import type { runningStateCapability } from './running-state.cap.js';
|
|
461
463
|
import type { rebootCapability } from './reboot.cap.js';
|
|
464
|
+
import type { lowPowerSleepCapability } from './low-power-sleep.cap.js';
|
|
465
|
+
import type { resyncCapability } from './resync.cap.js';
|
|
462
466
|
import type { recordingCapability } from './recording.cap.js';
|
|
463
467
|
import type { recordingArchiveCapability } from './recording-archive.cap.js';
|
|
464
468
|
import type { recordingExportCapability } from './recording-export.cap.js';
|
|
@@ -507,6 +511,6 @@ import type { trainingProviderCapability } from './training-provider.cap.js';
|
|
|
507
511
|
import type { zoneAnalyticsCapability } from './zone-analytics.cap.js';
|
|
508
512
|
import type { zoneRulesCapability } from './zone-rules.cap.js';
|
|
509
513
|
import type { zonesCapability } from './zones.cap.js';
|
|
510
|
-
type AnyCapability = typeof streamSignalsCapability | typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof storageOccupancyCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof databaseSnapshotCapability | typeof migrationsCapability | typeof storageAdminCapability | typeof recordsCapability | typeof recordEntriesCapability | typeof deviceHistoryCapability | typeof deviceRunsCapability | typeof deviceTransitionsCapability | typeof timedRunCapability | typeof doNotDisturbCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof nodeRemovalHookCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceAdminLinkCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof calendarSourceCapability | typeof calendarsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof boardKeySourceCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof composerCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof navigationCapability | typeof consumablesCapability | typeof runningStateCapability | typeof rebootCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof weatherStationCapability | typeof imageCapability | typeof lockControlCapability | typeof powerSourceCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof petFountainCapability | typeof pumpCycleCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof meterCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof actionSourceCapability | typeof actionsCapability | typeof schedulersCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof sirenCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof trainingCapability | typeof trainingProviderCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof groupActiveCapability | typeof groupCommandsCapability | typeof groupStatusCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof heatingValveCapability | typeof heatPumpStatusCapability | typeof energySystemCapability | typeof workloadCapability | typeof heatPumpControlCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingArchiveCapability | typeof recordingExportCapability | typeof recordingSignalCapability | typeof deviceOpsCapability | typeof displayPaletteCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof clusterUpdateCapability | typeof integrationsCapability | typeof integrationInstancesCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof cameraGridLayoutCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof recordingOnboardCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof errorCapability | typeof networkLinkCapability | typeof buttonCapability | typeof irTransmitterCapability | typeof remoteCapability | typeof heroLayoutCapability | typeof fanPresetsCapability | typeof templateCapability | typeof tagsCapability | typeof remoteLayoutComponentsCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability | typeof deviceExtensionCapability | typeof dishwasherCapability;
|
|
514
|
+
type AnyCapability = typeof streamSignalsCapability | typeof addonSettingsCapability | typeof alertsCapability | typeof storageCapability | typeof storageMigrationCapability | typeof storageProviderCapability | typeof storageEvictableCapability | typeof storageOccupancyCapability | typeof filesystemBrowseCapability | typeof backupCapability | typeof terminalSessionCapability | typeof settingsStoreCapability | typeof dataStoreProviderCapability | typeof databaseSnapshotCapability | typeof migrationsCapability | typeof storageAdminCapability | typeof recordsCapability | typeof recordEntriesCapability | typeof deviceHistoryCapability | typeof deviceRunsCapability | typeof deviceTransitionsCapability | typeof timedRunCapability | typeof doNotDisturbCapability | typeof keychainCapability | typeof keychainAdminCapability | typeof deviceCredentialsCapability | typeof nodeCertificatesCapability | typeof logChannelsCapability | typeof logDestinationCapability | typeof loadContributionCapability | typeof failureContributionCapability | typeof deviceRemovalHookCapability | typeof nodeRemovalHookCapability | typeof adminUiCapability | typeof viewerUiCapability | typeof ssoBridgeCapability | typeof userPasskeysCapability | typeof smtpProviderCapability | typeof mqttBrokerCapability | typeof brokerCapability | typeof deviceAdoptionCapability | typeof deviceAdminLinkCapability | typeof deviceExportCapability | typeof addonPagesCapability | typeof addonPagesSourceCapability | typeof addonWidgetsCapability | typeof addonWidgetsSourceCapability | typeof customModelRegistryCapability | typeof modelDistributorCapability | typeof modelConvertCapability | typeof addonRoutesCapability | typeof streamBrokerCapability | typeof decoderCapability | typeof webrtcSessionCapability | typeof cameraStreamsCapability | typeof calendarSourceCapability | typeof calendarsCapability | typeof motionDetectionCapability | typeof pipelineExecutorCapability | typeof detectionPipelineCapability | typeof cameraPipelineConfigCapability | typeof pipelineRunnerCapability | typeof pipelineOrchestratorCapability | typeof audioAnalyzerCapability | typeof audioAnalysisCapability | typeof audioCodecCapability | typeof embeddingEncoderCapability | typeof vectorStoreCapability | typeof deviceProviderCapability | typeof deviceManagerCapability | typeof deviceStateCapability | typeof authProviderCapability | typeof loginMethodCapability | typeof networkAccessCapability | typeof boardKeySourceCapability | typeof turnProviderCapability | typeof snapshotCapability | typeof llmCapability | typeof llmRuntimeCapability | typeof notificationOutputCapability | typeof composerCapability | typeof coreBlocksCapability | typeof notificationRulesCapability | typeof pipelineAnalyticsCapability | typeof metricsProviderCapability | typeof ptzCapability | typeof ptzAutotrackCapability | typeof navigationCapability | typeof consumablesCapability | typeof runningStateCapability | typeof rebootCapability | typeof lowPowerSleepCapability | typeof resyncCapability | typeof brightnessCapability | typeof colorCapability | typeof climateControlCapability | typeof coverCapability | typeof valveCapability | typeof humidifierCapability | typeof waterHeaterCapability | typeof weatherCapability | typeof weatherStationCapability | typeof imageCapability | typeof lockControlCapability | typeof powerSourceCapability | typeof vacuumControlCapability | typeof petFeederCapability | typeof petFountainCapability | typeof pumpCycleCapability | typeof lawnMowerControlCapability | typeof fanControlCapability | typeof controlCapability | typeof notifierCapability | typeof mediaPlayerCapability | typeof meterCapability | typeof alarmPanelCapability | typeof presenceCapability | typeof scriptRunnerCapability | typeof actionSourceCapability | typeof actionsCapability | typeof schedulersCapability | typeof automationControlCapability | typeof motionTriggerCapability | typeof sirenCapability | typeof zonesCapability | typeof zoneRulesCapability | typeof trainingCapability | typeof trainingProviderCapability | typeof zoneAnalyticsCapability | typeof audioMetricsCapability | typeof motionCapability | typeof contactCapability | typeof floodCapability | typeof smokeCapability | typeof carbonMonoxideCapability | typeof gasCapability | typeof groupActiveCapability | typeof groupCommandsCapability | typeof groupStatusCapability | typeof tamperCapability | typeof vibrationCapability | typeof connectivityCapability | typeof binaryCapability | typeof temperatureSensorCapability | typeof heatingValveCapability | typeof heatPumpStatusCapability | typeof energySystemCapability | typeof workloadCapability | typeof heatPumpControlCapability | typeof humiditySensorCapability | typeof ambientLightSensorCapability | typeof pressureSensorCapability | typeof powerMeterCapability | typeof airQualitySensorCapability | typeof numericSensorCapability | typeof enumSensorCapability | typeof recordingCapability | typeof recordingArchiveCapability | typeof recordingExportCapability | typeof recordingSignalCapability | typeof deviceOpsCapability | typeof displayPaletteCapability | typeof platformProbeCapability | typeof localNetworkCapability | typeof meshNetworkCapability | typeof userManagementCapability | typeof systemCapability | typeof networkQualityCapability | typeof toastCapability | typeof nodesCapability | typeof serverManagementCapability | typeof clusterUpdateCapability | typeof integrationsCapability | typeof integrationInstancesCapability | typeof addonsCapability | typeof oauthIntegrationCapability | typeof streamParamsCapability | typeof streamCatalogCapability | typeof motionZonesCapability | typeof cameraGridLayoutCapability | typeof sceneMonitorCapability | typeof privacyMaskCapability | typeof dayNightCapability | typeof recordingOnboardCapability | typeof imageSettingsCapability | typeof osdCapability | typeof osdManagerCapability | typeof accessoriesCapability | typeof batteryCapability | typeof errorCapability | typeof networkLinkCapability | typeof buttonCapability | typeof irTransmitterCapability | typeof remoteCapability | typeof heroLayoutCapability | typeof fanPresetsCapability | typeof templateCapability | typeof tagsCapability | typeof remoteLayoutComponentsCapability | typeof cameraCredentialsCapability | typeof deviceStatusCapability | typeof doorbellCapability | typeof eventEmitterCapability | typeof faceGalleryCapability | typeof featureProbeCapability | typeof intercomCapability | typeof nativeObjectDetectionCapability | typeof plateGalleryCapability | typeof switchCapability | typeof updateCapability | typeof videoclipsCapability | typeof deviceExtensionCapability | typeof dishwasherCapability;
|
|
511
515
|
export type CapabilityName = AnyCapability['name'];
|
|
512
516
|
export type ITypedReadinessRegistry = IReadinessRegistry<CapabilityName>;
|
|
@@ -12,8 +12,8 @@ import { DeviceType } from '../device/device-type.js';
|
|
|
12
12
|
* (workplace keypad locks, hospitality). The optional `code` field
|
|
13
13
|
* on the methods passes it through to the upstream service — the
|
|
14
14
|
* code is NEVER persisted in the runtime slice or any event payload.
|
|
15
|
-
*
|
|
16
|
-
* the
|
|
15
|
+
* Whether a lock REQUIRES a code is the slice's `codeRequired` (#459):
|
|
16
|
+
* `true` / `false` when the provider knows, `null` when it does not (D393).
|
|
17
17
|
*
|
|
18
18
|
* Locks that support a latch-release ("open door") action advertise
|
|
19
19
|
* `DeviceFeature.LockOpen`. The `open` method triggers the latch
|
|
@@ -48,6 +48,7 @@ export declare const LockControlStatusSchema: z.ZodObject<{
|
|
|
48
48
|
unlocked: "unlocked";
|
|
49
49
|
unlocking: "unlocking";
|
|
50
50
|
}>;
|
|
51
|
+
codeRequired: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
51
52
|
lastChangedAt: z.ZodNumber;
|
|
52
53
|
}, z.core.$strip>;
|
|
53
54
|
export type LockControlStatus = z.infer<typeof LockControlStatusSchema>;
|
|
@@ -83,6 +84,7 @@ export declare const lockControlCapability: {
|
|
|
83
84
|
unlocked: "unlocked";
|
|
84
85
|
unlocking: "unlocking";
|
|
85
86
|
}>;
|
|
87
|
+
codeRequired: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
86
88
|
lastChangedAt: z.ZodNumber;
|
|
87
89
|
}, z.core.$strip>;
|
|
88
90
|
readonly kind: 'push';
|
|
@@ -101,6 +103,7 @@ export declare const lockControlCapability: {
|
|
|
101
103
|
unlocked: "unlocked";
|
|
102
104
|
unlocking: "unlocking";
|
|
103
105
|
}>;
|
|
106
|
+
codeRequired: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
104
107
|
lastChangedAt: z.ZodNumber;
|
|
105
108
|
}, z.core.$strip>;
|
|
106
109
|
readonly customize: {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type InferProvider } from './capability-definition.js';
|
|
3
|
+
import { DeviceType } from '../device/device-type.js';
|
|
4
|
+
/**
|
|
5
|
+
* low-power-sleep — a device that goes into low-power sleep and must be WOKEN
|
|
6
|
+
* before it streams (#459, Q2). A battery camera (Reolink Argus, a robot's
|
|
7
|
+
* on-board camera) is one; a battery SENSOR is not: it reports charge on the
|
|
8
|
+
* `battery` cap and never sleeps. The two meanings used to share
|
|
9
|
+
* `DeviceFeature.BatteryOperated`; this cap is the one that answers "sleeps",
|
|
10
|
+
* and `DeviceFeature.Sleeps` is derived from it being bound with
|
|
11
|
+
* `wakeUp` implemented.
|
|
12
|
+
*
|
|
13
|
+
* The state is the sleep inputs (`deriveBatteryPresence`): whether the device
|
|
14
|
+
* is asleep, and the last time it PROVED it was reachable. Read from this slice
|
|
15
|
+
* by the stream broker (`readBatterySleepFacts`), the recorder
|
|
16
|
+
* (`recordingWakeDeps`) and the snapshot builtin. The broker's per-device
|
|
17
|
+
* mirror is still also fed by `BatteryOnStatusChanged` events.
|
|
18
|
+
*/
|
|
19
|
+
export declare const LowPowerSleepStatusSchema: z.ZodObject<{
|
|
20
|
+
sleeping: z.ZodBoolean;
|
|
21
|
+
lastContactAt: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
lastUpdated: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type LowPowerSleepStatus = z.infer<typeof LowPowerSleepStatusSchema>;
|
|
25
|
+
export declare const lowPowerSleepCapability: {
|
|
26
|
+
readonly name: 'low-power-sleep';
|
|
27
|
+
readonly scope: 'device';
|
|
28
|
+
readonly deviceNative: true;
|
|
29
|
+
readonly mode: 'singleton';
|
|
30
|
+
readonly deviceTypes: readonly [DeviceType.Camera];
|
|
31
|
+
readonly methods: {
|
|
32
|
+
/**
|
|
33
|
+
* Explicitly wake the device from low-power sleep ahead of a streaming
|
|
34
|
+
* session start. Consumers that initiate a stream against a sleeping
|
|
35
|
+
* camera (wake-on-play, the recorder, HomeKit, Alexa, snapshot wrappers)
|
|
36
|
+
* call this with a short timeout before establishing the media pipeline —
|
|
37
|
+
* the broker's own passive wake-on-dial works but adds 5–7 seconds to
|
|
38
|
+
* first-frame. Pre-waking compresses that gap.
|
|
39
|
+
*
|
|
40
|
+
* Returns `awoke: true` when the firmware acknowledged the wake before
|
|
41
|
+
* `timeoutMs`, `awoke: false` when it timed out; the caller should still
|
|
42
|
+
* attempt the stream — the passive broker wake remains as fallback.
|
|
43
|
+
*/
|
|
44
|
+
readonly wakeUp: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
45
|
+
deviceId: z.ZodNumber;
|
|
46
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
+
awoke: z.ZodBoolean;
|
|
49
|
+
durationMs: z.ZodNumber;
|
|
50
|
+
}, z.core.$strip>, "mutation">;
|
|
51
|
+
};
|
|
52
|
+
readonly status: {
|
|
53
|
+
readonly schema: z.ZodObject<{
|
|
54
|
+
sleeping: z.ZodBoolean;
|
|
55
|
+
lastContactAt: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
lastUpdated: z.ZodNumber;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
readonly kind: 'push';
|
|
59
|
+
readonly empty: {
|
|
60
|
+
readonly sleeping: false;
|
|
61
|
+
readonly lastUpdated: 0;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
readonly runtimeState: z.ZodObject<{
|
|
65
|
+
sleeping: z.ZodBoolean;
|
|
66
|
+
lastContactAt: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
lastUpdated: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
/**
|
|
70
|
+
* Runtime-state durability: **restored** — a sleeping camera may not report
|
|
71
|
+
* for hours; the restored sleep inputs are the only thing the sleep gate and
|
|
72
|
+
* the presence derivation have (the same argument as `battery`).
|
|
73
|
+
*/
|
|
74
|
+
readonly durability: 'restored';
|
|
75
|
+
/** History (D850): none — battery never recorded a sleep series either. */
|
|
76
|
+
readonly history: 'none';
|
|
77
|
+
readonly volatileStateFields: readonly ["lastUpdated"];
|
|
78
|
+
readonly vocabulary: {
|
|
79
|
+
readonly noun: import("../index.js").VocabL10n;
|
|
80
|
+
readonly order: 5245;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export type ILowPowerSleepProvider = InferProvider<typeof lowPowerSleepCapability>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type InferProvider } from './capability-definition.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { DeviceType } from '../device/device-type.js';
|
|
4
|
+
/**
|
|
5
|
+
* resync — a device whose derived spec can be re-aligned on demand with its
|
|
6
|
+
* upstream source (#459, Q6). Registered by the containers an integration
|
|
7
|
+
* adopted; `DeviceFeature.Resyncable` (the generic Re-sync button) is derived
|
|
8
|
+
* from it being bound with `resync` implemented.
|
|
9
|
+
*
|
|
10
|
+
* The work itself stays where it is: the owning addon's `device-adoption`
|
|
11
|
+
* provider, reached through `deviceManager.adoptionResync` (which also owns
|
|
12
|
+
* the "resync from zero" child purge). A provider answers this method by
|
|
13
|
+
* asking for exactly that — see `resyncThroughAdoption`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ResyncDeviceInputSchema: z.ZodObject<{
|
|
16
|
+
deviceId: z.ZodNumber;
|
|
17
|
+
resetToSource: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const resyncCapability: {
|
|
20
|
+
readonly name: 'resync';
|
|
21
|
+
readonly scope: 'device';
|
|
22
|
+
readonly deviceNative: true;
|
|
23
|
+
readonly mode: 'singleton';
|
|
24
|
+
readonly deviceTypes: readonly [DeviceType.Container, DeviceType.Workload, DeviceType.WeatherStation];
|
|
25
|
+
readonly methods: {
|
|
26
|
+
readonly resync: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
27
|
+
deviceId: z.ZodNumber;
|
|
28
|
+
resetToSource: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
+
changed: z.ZodBoolean;
|
|
31
|
+
rebuiltChildren: z.ZodNumber;
|
|
32
|
+
removedChildren: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
}, z.core.$strip>, "mutation">;
|
|
34
|
+
};
|
|
35
|
+
readonly vocabulary: {
|
|
36
|
+
readonly noun: import("../index.js").VocabL10n;
|
|
37
|
+
readonly order: 3245;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type IResyncProvider = InferProvider<typeof resyncCapability>;
|
package/dist/client.js
CHANGED
|
@@ -21830,9 +21830,8 @@ function t(en, it) {
|
|
|
21830
21830
|
* Many panels require a PIN code on arm / disarm — the optional
|
|
21831
21831
|
* `code` field on the methods passes it through to the upstream
|
|
21832
21832
|
* service; it's NEVER persisted in the runtime slice or any event
|
|
21833
|
-
* payload.
|
|
21834
|
-
* `
|
|
21835
|
-
* field without a slice fetch.
|
|
21833
|
+
* payload. Whether a code is required is the slice's `codeRequired`
|
|
21834
|
+
* (#459): `null` when the provider cannot tell (D393).
|
|
21836
21835
|
*
|
|
21837
21836
|
* `availableModes` mirrors HA's `supported_features`-derived arm
|
|
21838
21837
|
* mode list — the UI renders only the buttons the panel accepts.
|
|
@@ -21871,9 +21870,13 @@ zod.z.object({
|
|
|
21871
21870
|
/** Subset of arm modes the panel accepts. UI renders one button per
|
|
21872
21871
|
* mode in this list. */
|
|
21873
21872
|
availableModes: zod.z.array(AlarmArmModeSchema),
|
|
21874
|
-
/**
|
|
21875
|
-
*
|
|
21876
|
-
requiresCode
|
|
21873
|
+
/**
|
|
21874
|
+
* Whether the panel requires a PIN on arm / disarm (#459; the field was
|
|
21875
|
+
* `requiresCode`, and the `alarm-pin-required` device feature is gone).
|
|
21876
|
+
* `null` = the provider cannot tell (D393), never `false`. A slice restored
|
|
21877
|
+
* from before the rename is upgraded at boot by `restoredFieldRenames`.
|
|
21878
|
+
*/
|
|
21879
|
+
codeRequired: zod.z.boolean().nullable(),
|
|
21877
21880
|
/** Ms epoch when the slice was last updated. */
|
|
21878
21881
|
lastChangedAt: zod.z.number()
|
|
21879
21882
|
});
|
|
@@ -21914,7 +21917,7 @@ DeviceType.AlarmPanel, method(zod.z.object({ deviceId: zod.z.number().int().nonn
|
|
|
21914
21917
|
}), method(zod.z.object({
|
|
21915
21918
|
deviceId: zod.z.number().int().nonnegative(),
|
|
21916
21919
|
mode: AlarmArmModeSchema,
|
|
21917
|
-
/** Optional PIN code. Required when `
|
|
21920
|
+
/** Optional PIN code. Required when `codeRequired === true`.
|
|
21918
21921
|
* Passed through to the upstream service; never persisted. */
|
|
21919
21922
|
code: zod.z.string().min(1).optional()
|
|
21920
21923
|
}), zod.z.void(), {
|
|
@@ -27649,10 +27652,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27649
27652
|
trigger: (input, options) => dispatch("automation-control", "automationControl", "trigger", "mutation", input, void 0, options),
|
|
27650
27653
|
getStatus: (input, options) => dispatch("automation-control", "automationControl", "getStatus", "query", input, void 0, options)
|
|
27651
27654
|
};
|
|
27652
|
-
const batteryInterface = {
|
|
27653
|
-
wakeForStream: (input, options) => dispatch("battery", "battery", "wakeForStream", "mutation", input, void 0, options),
|
|
27654
|
-
getStatus: (input, options) => dispatch("battery", "battery", "getStatus", "query", input, void 0, options)
|
|
27655
|
-
};
|
|
27655
|
+
const batteryInterface = { getStatus: (input, options) => dispatch("battery", "battery", "getStatus", "query", input, void 0, options) };
|
|
27656
27656
|
const binaryInterface = { getStatus: (input, options) => dispatch("binary", "binary", "getStatus", "query", input, void 0, options) };
|
|
27657
27657
|
const brightnessInterface = {
|
|
27658
27658
|
setBrightness: (input, options) => dispatch("brightness", "brightness", "setBrightness", "mutation", input, void 0, options),
|
|
@@ -27856,6 +27856,10 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27856
27856
|
open: (input, options) => dispatch("lock-control", "lockControl", "open", "mutation", input, void 0, options),
|
|
27857
27857
|
getStatus: (input, options) => dispatch("lock-control", "lockControl", "getStatus", "query", input, void 0, options)
|
|
27858
27858
|
};
|
|
27859
|
+
const lowPowerSleepInterface = {
|
|
27860
|
+
wakeUp: (input, options) => dispatch("low-power-sleep", "lowPowerSleep", "wakeUp", "mutation", input, void 0, options),
|
|
27861
|
+
getStatus: (input, options) => dispatch("low-power-sleep", "lowPowerSleep", "getStatus", "query", input, void 0, options)
|
|
27862
|
+
};
|
|
27859
27863
|
const mediaPlayerInterface = {
|
|
27860
27864
|
turnOn: (input, options) => dispatch("media-player", "mediaPlayer", "turnOn", "mutation", input, void 0, options),
|
|
27861
27865
|
turnOff: (input, options) => dispatch("media-player", "mediaPlayer", "turnOff", "mutation", input, void 0, options),
|
|
@@ -28097,6 +28101,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28097
28101
|
getStatus: (input, options) => dispatch("recording-onboard", "recordingOnboard", "getStatus", "query", input, void 0, options)
|
|
28098
28102
|
};
|
|
28099
28103
|
const recordingSignalInterface = { getStatus: (input, options) => dispatch("recording-signal", "recordingSignal", "getStatus", "query", input, void 0, options) };
|
|
28104
|
+
const resyncInterface = { resync: (input, options) => dispatch("resync", "resync", "resync", "mutation", input, void 0, options) };
|
|
28100
28105
|
const runningStateInterface = { getStatus: (input, options) => dispatch("running-state", "runningState", "getStatus", "query", input, void 0, options) };
|
|
28101
28106
|
const sceneMonitorInterface = {
|
|
28102
28107
|
listScenes: (input, options) => dispatch("scene-monitor", "sceneMonitor", "listScenes", "query", input, void 0, options),
|
|
@@ -28454,6 +28459,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28454
28459
|
irTransmitter: createSliceHandle(stateSource, binding.deviceId, "ir-transmitter"),
|
|
28455
28460
|
lawnMowerControl: createSliceHandle(stateSource, binding.deviceId, "lawn-mower-control"),
|
|
28456
28461
|
lockControl: createSliceHandle(stateSource, binding.deviceId, "lock-control"),
|
|
28462
|
+
lowPowerSleep: createSliceHandle(stateSource, binding.deviceId, "low-power-sleep"),
|
|
28457
28463
|
mediaPlayer: createSliceHandle(stateSource, binding.deviceId, "media-player"),
|
|
28458
28464
|
meter: createSliceHandle(stateSource, binding.deviceId, "meter"),
|
|
28459
28465
|
motion: createSliceHandle(stateSource, binding.deviceId, "motion"),
|
|
@@ -28555,6 +28561,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28555
28561
|
...bound("ir-transmitter") ? { irTransmitter: irTransmitterInterface } : {},
|
|
28556
28562
|
...bound("lawn-mower-control") ? { lawnMowerControl: lawnMowerControlInterface } : {},
|
|
28557
28563
|
...bound("lock-control") ? { lockControl: lockControlInterface } : {},
|
|
28564
|
+
...bound("low-power-sleep") ? { lowPowerSleep: lowPowerSleepInterface } : {},
|
|
28558
28565
|
...bound("media-player") ? { mediaPlayer: mediaPlayerInterface } : {},
|
|
28559
28566
|
...bound("meter") ? { meter: meterInterface } : {},
|
|
28560
28567
|
...bound("motion") ? { motion: motionInterface } : {},
|
|
@@ -28582,6 +28589,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28582
28589
|
...bound("recording") ? { recording: recordingInterface } : {},
|
|
28583
28590
|
...bound("recording-onboard") ? { recordingOnboard: recordingOnboardInterface } : {},
|
|
28584
28591
|
...bound("recording-signal") ? { recordingSignal: recordingSignalInterface } : {},
|
|
28592
|
+
...bound("resync") ? { resync: resyncInterface } : {},
|
|
28585
28593
|
...bound("running-state") ? { runningState: runningStateInterface } : {},
|
|
28586
28594
|
...bound("scene-monitor") ? { sceneMonitor: sceneMonitorInterface } : {},
|
|
28587
28595
|
...bound("script-runner") ? { scriptRunner: scriptRunnerInterface } : {},
|