@camstack/addon-matter-broker 0.2.68 → 0.2.70
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 +483 -1
- package/dist/addon.mjs +483 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -13,7 +13,7 @@ let node_stream_promises = require("node:stream/promises");
|
|
|
13
13
|
let node_net = require("node:net");
|
|
14
14
|
let node_dgram = require("node:dgram");
|
|
15
15
|
node_dgram = require_esm.__toESM(node_dgram, 1);
|
|
16
|
-
//#region ../types/dist/event-category-
|
|
16
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
17
17
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
18
18
|
EventCategory["SystemBoot"] = "system.boot";
|
|
19
19
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -385,6 +385,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
385
385
|
*/
|
|
386
386
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
387
387
|
/**
|
|
388
|
+
* Cap event fired by every device that registers the `network-link`
|
|
389
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
390
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
391
|
+
* reading that moved.
|
|
392
|
+
*/
|
|
393
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
394
|
+
/**
|
|
388
395
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
389
396
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
390
397
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23829,6 +23836,88 @@ onStatusChanged: { data: object({
|
|
|
23829
23836
|
volatileStateFields: ["lastUpdated"]
|
|
23830
23837
|
};
|
|
23831
23838
|
/**
|
|
23839
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23840
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23841
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23842
|
+
* one Home Assistant projection.
|
|
23843
|
+
*/
|
|
23844
|
+
var NetworkLinkStatusSchema = object({
|
|
23845
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23846
|
+
type: _enum([
|
|
23847
|
+
"wifi",
|
|
23848
|
+
"ethernet",
|
|
23849
|
+
"cellular",
|
|
23850
|
+
"unknown"
|
|
23851
|
+
]),
|
|
23852
|
+
/**
|
|
23853
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23854
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23855
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23856
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23857
|
+
* SKIP a null rather than coerce it.
|
|
23858
|
+
*/
|
|
23859
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23860
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23861
|
+
rssiDbm: number().optional(),
|
|
23862
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23863
|
+
ssid: string$2().optional(),
|
|
23864
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23865
|
+
lastUpdated: number()
|
|
23866
|
+
});
|
|
23867
|
+
var networkLinkCapability = {
|
|
23868
|
+
name: "network-link",
|
|
23869
|
+
scope: "device",
|
|
23870
|
+
deviceNative: true,
|
|
23871
|
+
mode: "singleton",
|
|
23872
|
+
deviceTypes: [
|
|
23873
|
+
DeviceType.Camera,
|
|
23874
|
+
DeviceType.Sensor,
|
|
23875
|
+
DeviceType.Button,
|
|
23876
|
+
DeviceType.Switch,
|
|
23877
|
+
DeviceType.Light,
|
|
23878
|
+
DeviceType.Lock,
|
|
23879
|
+
DeviceType.Siren
|
|
23880
|
+
],
|
|
23881
|
+
methods: {},
|
|
23882
|
+
events: {
|
|
23883
|
+
/**
|
|
23884
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23885
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23886
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23887
|
+
*/
|
|
23888
|
+
onStatusChanged: { data: object({
|
|
23889
|
+
deviceId: number(),
|
|
23890
|
+
status: NetworkLinkStatusSchema
|
|
23891
|
+
}) } },
|
|
23892
|
+
status: {
|
|
23893
|
+
schema: NetworkLinkStatusSchema,
|
|
23894
|
+
kind: "push",
|
|
23895
|
+
empty: {
|
|
23896
|
+
type: "unknown",
|
|
23897
|
+
signalPercent: null,
|
|
23898
|
+
lastUpdated: 0
|
|
23899
|
+
}
|
|
23900
|
+
},
|
|
23901
|
+
/**
|
|
23902
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23903
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23904
|
+
* Home Assistant projector regardless of the driver.
|
|
23905
|
+
*/
|
|
23906
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23907
|
+
/**
|
|
23908
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23909
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23910
|
+
* restored slice is what the badge shows until the next read.
|
|
23911
|
+
*
|
|
23912
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23913
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23914
|
+
*/
|
|
23915
|
+
durability: "restored",
|
|
23916
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23917
|
+
* whether persisting is worth a SQLite commit. */
|
|
23918
|
+
volatileStateFields: ["lastUpdated"]
|
|
23919
|
+
};
|
|
23920
|
+
/**
|
|
23832
23921
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23833
23922
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23834
23923
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -28955,6 +29044,287 @@ var ptzAutotrackCapability = {
|
|
|
28955
29044
|
*/
|
|
28956
29045
|
durability: "session"
|
|
28957
29046
|
};
|
|
29047
|
+
/**
|
|
29048
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
29049
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
29050
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
29051
|
+
*
|
|
29052
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
29053
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
29054
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
29055
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
29056
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
29057
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
29058
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
29059
|
+
* the reverse:
|
|
29060
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
29061
|
+
* / `getOptions`), and
|
|
29062
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
29063
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
29064
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
29065
|
+
* not here (see the addon design note):
|
|
29066
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
29067
|
+
* ptz.stop() → navigation.stop()
|
|
29068
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
29069
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
29070
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
29071
|
+
*
|
|
29072
|
+
* ## Continuous drive
|
|
29073
|
+
*
|
|
29074
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
29075
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
29076
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
29077
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
29078
|
+
* coalesce them. The UI owns the cadence.
|
|
29079
|
+
*
|
|
29080
|
+
* ## The action dictionary
|
|
29081
|
+
*
|
|
29082
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
29083
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
29084
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
29085
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
29086
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
29087
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
29088
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
29089
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
29090
|
+
*
|
|
29091
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
29092
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
29093
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
29094
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
29095
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
29096
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
29097
|
+
* THIS contract.
|
|
29098
|
+
*/
|
|
29099
|
+
/**
|
|
29100
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
29101
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
29102
|
+
* halts it.
|
|
29103
|
+
*
|
|
29104
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
29105
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
29106
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
29107
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
29108
|
+
*
|
|
29109
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
29110
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
29111
|
+
*/
|
|
29112
|
+
var NavigationMoveCommandSchema = object({
|
|
29113
|
+
pan: number().min(-1).max(1).optional(),
|
|
29114
|
+
tilt: number().min(-1).max(1).optional(),
|
|
29115
|
+
speed: number().min(0).max(1).optional()
|
|
29116
|
+
});
|
|
29117
|
+
/**
|
|
29118
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
29119
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
29120
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
29121
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
29122
|
+
*/
|
|
29123
|
+
var NavigationActionIdSchema = _enum([
|
|
29124
|
+
"goHome",
|
|
29125
|
+
"locate",
|
|
29126
|
+
"spotClean",
|
|
29127
|
+
"findPet",
|
|
29128
|
+
"personFollow",
|
|
29129
|
+
"stop",
|
|
29130
|
+
"startClean",
|
|
29131
|
+
"pauseClean",
|
|
29132
|
+
"dockWash",
|
|
29133
|
+
"autoEmpty",
|
|
29134
|
+
"flashOn",
|
|
29135
|
+
"flashOff"
|
|
29136
|
+
]);
|
|
29137
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
29138
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
29139
|
+
/**
|
|
29140
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
29141
|
+
* native panel and the PTZ mimic render as a button.
|
|
29142
|
+
*
|
|
29143
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
29144
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
29145
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
29146
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
29147
|
+
* - `label` — operator-facing English label.
|
|
29148
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
29149
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
29150
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
29151
|
+
* flips it from config, never by editing code.
|
|
29152
|
+
*/
|
|
29153
|
+
var NavigationActionEntrySchema = object({
|
|
29154
|
+
id: string$2(),
|
|
29155
|
+
kind: NavigationEntryKindSchema,
|
|
29156
|
+
label: string$2(),
|
|
29157
|
+
icon: string$2(),
|
|
29158
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
29159
|
+
soundId: number().int().optional(),
|
|
29160
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
29161
|
+
enabled: boolean()
|
|
29162
|
+
});
|
|
29163
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
29164
|
+
var NavigationPointSchema = object({
|
|
29165
|
+
x: number(),
|
|
29166
|
+
y: number()
|
|
29167
|
+
});
|
|
29168
|
+
/**
|
|
29169
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
29170
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
29171
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
29172
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
29173
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
29174
|
+
* that are not dictionary entries.
|
|
29175
|
+
*
|
|
29176
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
29177
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
29178
|
+
* map-coordinate plumbing is wired.
|
|
29179
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
29180
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
29181
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
29182
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
29183
|
+
* camera-service control; needs an active stream).
|
|
29184
|
+
*/
|
|
29185
|
+
var NavigationFeaturesSchema = object({
|
|
29186
|
+
move: boolean(),
|
|
29187
|
+
stop: boolean(),
|
|
29188
|
+
goToPoint: boolean(),
|
|
29189
|
+
runAction: boolean(),
|
|
29190
|
+
playSound: boolean(),
|
|
29191
|
+
light: boolean(),
|
|
29192
|
+
lightMode: boolean()
|
|
29193
|
+
});
|
|
29194
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
29195
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
29196
|
+
/**
|
|
29197
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
29198
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
29199
|
+
* - `following` — person/pet follow is currently armed.
|
|
29200
|
+
* - `flash` — the on-camera fill light is on.
|
|
29201
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
29202
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
29203
|
+
* `lightMode === 'manual'`.
|
|
29204
|
+
*/
|
|
29205
|
+
var NavigationStatusSchema = object({
|
|
29206
|
+
mode: _enum([
|
|
29207
|
+
"idle",
|
|
29208
|
+
"cleaning",
|
|
29209
|
+
"spot",
|
|
29210
|
+
"following",
|
|
29211
|
+
"goto",
|
|
29212
|
+
"returning",
|
|
29213
|
+
"paused",
|
|
29214
|
+
"unknown"
|
|
29215
|
+
]),
|
|
29216
|
+
following: boolean(),
|
|
29217
|
+
flash: boolean(),
|
|
29218
|
+
lightMode: NavigationLightModeSchema,
|
|
29219
|
+
lightLevel: number().min(40).max(100),
|
|
29220
|
+
/** Ms epoch when the slice was last updated. */
|
|
29221
|
+
lastChangedAt: number()
|
|
29222
|
+
});
|
|
29223
|
+
/**
|
|
29224
|
+
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
29225
|
+
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
29226
|
+
* convention.
|
|
29227
|
+
*/
|
|
29228
|
+
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
29229
|
+
var navigationCapability = {
|
|
29230
|
+
name: "navigation",
|
|
29231
|
+
scope: "device",
|
|
29232
|
+
deviceNative: true,
|
|
29233
|
+
mode: "singleton",
|
|
29234
|
+
deviceTypes: [DeviceType.Camera],
|
|
29235
|
+
deviceConfig: { ui: {
|
|
29236
|
+
kind: "widget",
|
|
29237
|
+
widgetId: "host/navigation-panel",
|
|
29238
|
+
tab: "navigation",
|
|
29239
|
+
topTab: true,
|
|
29240
|
+
label: "Navigation",
|
|
29241
|
+
order: 0
|
|
29242
|
+
} },
|
|
29243
|
+
methods: {
|
|
29244
|
+
/**
|
|
29245
|
+
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
29246
|
+
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
29247
|
+
* path) works for any authenticated user, not admin-only. The UI sends
|
|
29248
|
+
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
29249
|
+
* a single drive write WITHOUT debouncing.
|
|
29250
|
+
*/
|
|
29251
|
+
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29252
|
+
/** Halt all motion immediately (zero drive vector). */
|
|
29253
|
+
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29254
|
+
/** Send the robot to a point on its live map. */
|
|
29255
|
+
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29256
|
+
/**
|
|
29257
|
+
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
29258
|
+
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
29259
|
+
*/
|
|
29260
|
+
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
29261
|
+
/**
|
|
29262
|
+
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
29263
|
+
* unsupported action ids are rejected by the provider.
|
|
29264
|
+
*/
|
|
29265
|
+
runAction: method(object({
|
|
29266
|
+
deviceId: number(),
|
|
29267
|
+
actionId: NavigationActionIdSchema
|
|
29268
|
+
}), _void(), { kind: "mutation" }),
|
|
29269
|
+
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
29270
|
+
playSound: method(object({
|
|
29271
|
+
deviceId: number(),
|
|
29272
|
+
soundId: number().int()
|
|
29273
|
+
}), _void(), { kind: "mutation" }),
|
|
29274
|
+
/**
|
|
29275
|
+
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
29276
|
+
* works anytime, no active stream required).
|
|
29277
|
+
*/
|
|
29278
|
+
setLightOn: method(object({
|
|
29279
|
+
deviceId: number(),
|
|
29280
|
+
on: boolean()
|
|
29281
|
+
}), _void(), { kind: "mutation" }),
|
|
29282
|
+
/**
|
|
29283
|
+
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
29284
|
+
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
29285
|
+
* action that generally needs an active camera stream/monitor session — the
|
|
29286
|
+
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
29287
|
+
*/
|
|
29288
|
+
setLightMode: method(object({
|
|
29289
|
+
deviceId: number(),
|
|
29290
|
+
mode: NavigationLightModeSchema,
|
|
29291
|
+
level: number().min(40).max(100).optional()
|
|
29292
|
+
}), _void(), { kind: "mutation" }),
|
|
29293
|
+
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
29294
|
+
setLightLevel: method(object({
|
|
29295
|
+
deviceId: number(),
|
|
29296
|
+
level: number().min(40).max(100)
|
|
29297
|
+
}), _void(), { kind: "mutation" }),
|
|
29298
|
+
/**
|
|
29299
|
+
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
29300
|
+
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
29301
|
+
* `listActions`).
|
|
29302
|
+
*/
|
|
29303
|
+
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
29304
|
+
},
|
|
29305
|
+
events: { onStatusChanged: { data: object({
|
|
29306
|
+
deviceId: number(),
|
|
29307
|
+
status: NavigationStatusSchema
|
|
29308
|
+
}) } },
|
|
29309
|
+
status: {
|
|
29310
|
+
schema: NavigationStatusSchema,
|
|
29311
|
+
kind: "push"
|
|
29312
|
+
},
|
|
29313
|
+
/**
|
|
29314
|
+
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
29315
|
+
* for live mode / follow / flash changes.
|
|
29316
|
+
*/
|
|
29317
|
+
runtimeState: NavigationRuntimeStateSchema,
|
|
29318
|
+
/**
|
|
29319
|
+
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
29320
|
+
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
29321
|
+
* that. The live handle re-publishes on connect.
|
|
29322
|
+
*
|
|
29323
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
29324
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
29325
|
+
*/
|
|
29326
|
+
durability: "session"
|
|
29327
|
+
};
|
|
28958
29328
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
28959
29329
|
kind: "mutation",
|
|
28960
29330
|
auth: "admin"
|
|
@@ -32230,6 +32600,8 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32230
32600
|
motionTrigger: motionTriggerCapability,
|
|
32231
32601
|
motionZones: motionZonesCapability,
|
|
32232
32602
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32603
|
+
navigation: navigationCapability,
|
|
32604
|
+
networkLink: networkLinkCapability,
|
|
32233
32605
|
notifier: notifierCapability,
|
|
32234
32606
|
numericSensor: numericSensorCapability,
|
|
32235
32607
|
petFeeder: petFeederCapability,
|
|
@@ -36083,6 +36455,66 @@ Object.freeze({
|
|
|
36083
36455
|
addonId: null,
|
|
36084
36456
|
access: "create"
|
|
36085
36457
|
},
|
|
36458
|
+
"navigation.getFeatures": {
|
|
36459
|
+
capName: "navigation",
|
|
36460
|
+
capScope: "device",
|
|
36461
|
+
addonId: null,
|
|
36462
|
+
access: "view"
|
|
36463
|
+
},
|
|
36464
|
+
"navigation.goToPoint": {
|
|
36465
|
+
capName: "navigation",
|
|
36466
|
+
capScope: "device",
|
|
36467
|
+
addonId: null,
|
|
36468
|
+
access: "create"
|
|
36469
|
+
},
|
|
36470
|
+
"navigation.listActions": {
|
|
36471
|
+
capName: "navigation",
|
|
36472
|
+
capScope: "device",
|
|
36473
|
+
addonId: null,
|
|
36474
|
+
access: "view"
|
|
36475
|
+
},
|
|
36476
|
+
"navigation.move": {
|
|
36477
|
+
capName: "navigation",
|
|
36478
|
+
capScope: "device",
|
|
36479
|
+
addonId: null,
|
|
36480
|
+
access: "create"
|
|
36481
|
+
},
|
|
36482
|
+
"navigation.playSound": {
|
|
36483
|
+
capName: "navigation",
|
|
36484
|
+
capScope: "device",
|
|
36485
|
+
addonId: null,
|
|
36486
|
+
access: "create"
|
|
36487
|
+
},
|
|
36488
|
+
"navigation.runAction": {
|
|
36489
|
+
capName: "navigation",
|
|
36490
|
+
capScope: "device",
|
|
36491
|
+
addonId: null,
|
|
36492
|
+
access: "create"
|
|
36493
|
+
},
|
|
36494
|
+
"navigation.setLightLevel": {
|
|
36495
|
+
capName: "navigation",
|
|
36496
|
+
capScope: "device",
|
|
36497
|
+
addonId: null,
|
|
36498
|
+
access: "create"
|
|
36499
|
+
},
|
|
36500
|
+
"navigation.setLightMode": {
|
|
36501
|
+
capName: "navigation",
|
|
36502
|
+
capScope: "device",
|
|
36503
|
+
addonId: null,
|
|
36504
|
+
access: "create"
|
|
36505
|
+
},
|
|
36506
|
+
"navigation.setLightOn": {
|
|
36507
|
+
capName: "navigation",
|
|
36508
|
+
capScope: "device",
|
|
36509
|
+
addonId: null,
|
|
36510
|
+
access: "create"
|
|
36511
|
+
},
|
|
36512
|
+
"navigation.stop": {
|
|
36513
|
+
capName: "navigation",
|
|
36514
|
+
capScope: "device",
|
|
36515
|
+
addonId: null,
|
|
36516
|
+
access: "create"
|
|
36517
|
+
},
|
|
36086
36518
|
"networkAccess.getEndpoint": {
|
|
36087
36519
|
capName: "network-access",
|
|
36088
36520
|
capScope: "system",
|
|
@@ -40178,6 +40610,56 @@ Object.freeze({
|
|
|
40178
40610
|
form: "single",
|
|
40179
40611
|
optional: false
|
|
40180
40612
|
}],
|
|
40613
|
+
"navigation.getFeatures": [{
|
|
40614
|
+
name: "deviceId",
|
|
40615
|
+
form: "single",
|
|
40616
|
+
optional: false
|
|
40617
|
+
}],
|
|
40618
|
+
"navigation.goToPoint": [{
|
|
40619
|
+
name: "deviceId",
|
|
40620
|
+
form: "single",
|
|
40621
|
+
optional: false
|
|
40622
|
+
}],
|
|
40623
|
+
"navigation.listActions": [{
|
|
40624
|
+
name: "deviceId",
|
|
40625
|
+
form: "single",
|
|
40626
|
+
optional: false
|
|
40627
|
+
}],
|
|
40628
|
+
"navigation.move": [{
|
|
40629
|
+
name: "deviceId",
|
|
40630
|
+
form: "single",
|
|
40631
|
+
optional: false
|
|
40632
|
+
}],
|
|
40633
|
+
"navigation.playSound": [{
|
|
40634
|
+
name: "deviceId",
|
|
40635
|
+
form: "single",
|
|
40636
|
+
optional: false
|
|
40637
|
+
}],
|
|
40638
|
+
"navigation.runAction": [{
|
|
40639
|
+
name: "deviceId",
|
|
40640
|
+
form: "single",
|
|
40641
|
+
optional: false
|
|
40642
|
+
}],
|
|
40643
|
+
"navigation.setLightLevel": [{
|
|
40644
|
+
name: "deviceId",
|
|
40645
|
+
form: "single",
|
|
40646
|
+
optional: false
|
|
40647
|
+
}],
|
|
40648
|
+
"navigation.setLightMode": [{
|
|
40649
|
+
name: "deviceId",
|
|
40650
|
+
form: "single",
|
|
40651
|
+
optional: false
|
|
40652
|
+
}],
|
|
40653
|
+
"navigation.setLightOn": [{
|
|
40654
|
+
name: "deviceId",
|
|
40655
|
+
form: "single",
|
|
40656
|
+
optional: false
|
|
40657
|
+
}],
|
|
40658
|
+
"navigation.stop": [{
|
|
40659
|
+
name: "deviceId",
|
|
40660
|
+
form: "single",
|
|
40661
|
+
optional: false
|
|
40662
|
+
}],
|
|
40181
40663
|
"networkQuality.getDeviceStats": [{
|
|
40182
40664
|
name: "deviceId",
|
|
40183
40665
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { networkInterfaces, tmpdir, uptime } from "node:os";
|
|
|
11
11
|
import { finished } from "node:stream/promises";
|
|
12
12
|
import { createConnection, createServer as createServer$2 } from "node:net";
|
|
13
13
|
import * as dgram from "node:dgram";
|
|
14
|
-
//#region ../types/dist/event-category-
|
|
14
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
15
15
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
16
16
|
EventCategory["SystemBoot"] = "system.boot";
|
|
17
17
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -383,6 +383,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
383
383
|
*/
|
|
384
384
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
385
385
|
/**
|
|
386
|
+
* Cap event fired by every device that registers the `network-link`
|
|
387
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
388
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
389
|
+
* reading that moved.
|
|
390
|
+
*/
|
|
391
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
392
|
+
/**
|
|
386
393
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
387
394
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
388
395
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23827,6 +23834,88 @@ onStatusChanged: { data: object({
|
|
|
23827
23834
|
volatileStateFields: ["lastUpdated"]
|
|
23828
23835
|
};
|
|
23829
23836
|
/**
|
|
23837
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23838
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23839
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23840
|
+
* one Home Assistant projection.
|
|
23841
|
+
*/
|
|
23842
|
+
var NetworkLinkStatusSchema = object({
|
|
23843
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23844
|
+
type: _enum([
|
|
23845
|
+
"wifi",
|
|
23846
|
+
"ethernet",
|
|
23847
|
+
"cellular",
|
|
23848
|
+
"unknown"
|
|
23849
|
+
]),
|
|
23850
|
+
/**
|
|
23851
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23852
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23853
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23854
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23855
|
+
* SKIP a null rather than coerce it.
|
|
23856
|
+
*/
|
|
23857
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23858
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23859
|
+
rssiDbm: number().optional(),
|
|
23860
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23861
|
+
ssid: string$2().optional(),
|
|
23862
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23863
|
+
lastUpdated: number()
|
|
23864
|
+
});
|
|
23865
|
+
var networkLinkCapability = {
|
|
23866
|
+
name: "network-link",
|
|
23867
|
+
scope: "device",
|
|
23868
|
+
deviceNative: true,
|
|
23869
|
+
mode: "singleton",
|
|
23870
|
+
deviceTypes: [
|
|
23871
|
+
DeviceType.Camera,
|
|
23872
|
+
DeviceType.Sensor,
|
|
23873
|
+
DeviceType.Button,
|
|
23874
|
+
DeviceType.Switch,
|
|
23875
|
+
DeviceType.Light,
|
|
23876
|
+
DeviceType.Lock,
|
|
23877
|
+
DeviceType.Siren
|
|
23878
|
+
],
|
|
23879
|
+
methods: {},
|
|
23880
|
+
events: {
|
|
23881
|
+
/**
|
|
23882
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23883
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23884
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23885
|
+
*/
|
|
23886
|
+
onStatusChanged: { data: object({
|
|
23887
|
+
deviceId: number(),
|
|
23888
|
+
status: NetworkLinkStatusSchema
|
|
23889
|
+
}) } },
|
|
23890
|
+
status: {
|
|
23891
|
+
schema: NetworkLinkStatusSchema,
|
|
23892
|
+
kind: "push",
|
|
23893
|
+
empty: {
|
|
23894
|
+
type: "unknown",
|
|
23895
|
+
signalPercent: null,
|
|
23896
|
+
lastUpdated: 0
|
|
23897
|
+
}
|
|
23898
|
+
},
|
|
23899
|
+
/**
|
|
23900
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23901
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23902
|
+
* Home Assistant projector regardless of the driver.
|
|
23903
|
+
*/
|
|
23904
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23905
|
+
/**
|
|
23906
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23907
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23908
|
+
* restored slice is what the badge shows until the next read.
|
|
23909
|
+
*
|
|
23910
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23911
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23912
|
+
*/
|
|
23913
|
+
durability: "restored",
|
|
23914
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23915
|
+
* whether persisting is worth a SQLite commit. */
|
|
23916
|
+
volatileStateFields: ["lastUpdated"]
|
|
23917
|
+
};
|
|
23918
|
+
/**
|
|
23830
23919
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23831
23920
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23832
23921
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -28953,6 +29042,287 @@ var ptzAutotrackCapability = {
|
|
|
28953
29042
|
*/
|
|
28954
29043
|
durability: "session"
|
|
28955
29044
|
};
|
|
29045
|
+
/**
|
|
29046
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
29047
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
29048
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
29049
|
+
*
|
|
29050
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
29051
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
29052
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
29053
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
29054
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
29055
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
29056
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
29057
|
+
* the reverse:
|
|
29058
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
29059
|
+
* / `getOptions`), and
|
|
29060
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
29061
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
29062
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
29063
|
+
* not here (see the addon design note):
|
|
29064
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
29065
|
+
* ptz.stop() → navigation.stop()
|
|
29066
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
29067
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
29068
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
29069
|
+
*
|
|
29070
|
+
* ## Continuous drive
|
|
29071
|
+
*
|
|
29072
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
29073
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
29074
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
29075
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
29076
|
+
* coalesce them. The UI owns the cadence.
|
|
29077
|
+
*
|
|
29078
|
+
* ## The action dictionary
|
|
29079
|
+
*
|
|
29080
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
29081
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
29082
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
29083
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
29084
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
29085
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
29086
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
29087
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
29088
|
+
*
|
|
29089
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
29090
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
29091
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
29092
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
29093
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
29094
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
29095
|
+
* THIS contract.
|
|
29096
|
+
*/
|
|
29097
|
+
/**
|
|
29098
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
29099
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
29100
|
+
* halts it.
|
|
29101
|
+
*
|
|
29102
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
29103
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
29104
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
29105
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
29106
|
+
*
|
|
29107
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
29108
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
29109
|
+
*/
|
|
29110
|
+
var NavigationMoveCommandSchema = object({
|
|
29111
|
+
pan: number().min(-1).max(1).optional(),
|
|
29112
|
+
tilt: number().min(-1).max(1).optional(),
|
|
29113
|
+
speed: number().min(0).max(1).optional()
|
|
29114
|
+
});
|
|
29115
|
+
/**
|
|
29116
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
29117
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
29118
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
29119
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
29120
|
+
*/
|
|
29121
|
+
var NavigationActionIdSchema = _enum([
|
|
29122
|
+
"goHome",
|
|
29123
|
+
"locate",
|
|
29124
|
+
"spotClean",
|
|
29125
|
+
"findPet",
|
|
29126
|
+
"personFollow",
|
|
29127
|
+
"stop",
|
|
29128
|
+
"startClean",
|
|
29129
|
+
"pauseClean",
|
|
29130
|
+
"dockWash",
|
|
29131
|
+
"autoEmpty",
|
|
29132
|
+
"flashOn",
|
|
29133
|
+
"flashOff"
|
|
29134
|
+
]);
|
|
29135
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
29136
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
29137
|
+
/**
|
|
29138
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
29139
|
+
* native panel and the PTZ mimic render as a button.
|
|
29140
|
+
*
|
|
29141
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
29142
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
29143
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
29144
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
29145
|
+
* - `label` — operator-facing English label.
|
|
29146
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
29147
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
29148
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
29149
|
+
* flips it from config, never by editing code.
|
|
29150
|
+
*/
|
|
29151
|
+
var NavigationActionEntrySchema = object({
|
|
29152
|
+
id: string$2(),
|
|
29153
|
+
kind: NavigationEntryKindSchema,
|
|
29154
|
+
label: string$2(),
|
|
29155
|
+
icon: string$2(),
|
|
29156
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
29157
|
+
soundId: number().int().optional(),
|
|
29158
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
29159
|
+
enabled: boolean()
|
|
29160
|
+
});
|
|
29161
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
29162
|
+
var NavigationPointSchema = object({
|
|
29163
|
+
x: number(),
|
|
29164
|
+
y: number()
|
|
29165
|
+
});
|
|
29166
|
+
/**
|
|
29167
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
29168
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
29169
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
29170
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
29171
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
29172
|
+
* that are not dictionary entries.
|
|
29173
|
+
*
|
|
29174
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
29175
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
29176
|
+
* map-coordinate plumbing is wired.
|
|
29177
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
29178
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
29179
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
29180
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
29181
|
+
* camera-service control; needs an active stream).
|
|
29182
|
+
*/
|
|
29183
|
+
var NavigationFeaturesSchema = object({
|
|
29184
|
+
move: boolean(),
|
|
29185
|
+
stop: boolean(),
|
|
29186
|
+
goToPoint: boolean(),
|
|
29187
|
+
runAction: boolean(),
|
|
29188
|
+
playSound: boolean(),
|
|
29189
|
+
light: boolean(),
|
|
29190
|
+
lightMode: boolean()
|
|
29191
|
+
});
|
|
29192
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
29193
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
29194
|
+
/**
|
|
29195
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
29196
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
29197
|
+
* - `following` — person/pet follow is currently armed.
|
|
29198
|
+
* - `flash` — the on-camera fill light is on.
|
|
29199
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
29200
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
29201
|
+
* `lightMode === 'manual'`.
|
|
29202
|
+
*/
|
|
29203
|
+
var NavigationStatusSchema = object({
|
|
29204
|
+
mode: _enum([
|
|
29205
|
+
"idle",
|
|
29206
|
+
"cleaning",
|
|
29207
|
+
"spot",
|
|
29208
|
+
"following",
|
|
29209
|
+
"goto",
|
|
29210
|
+
"returning",
|
|
29211
|
+
"paused",
|
|
29212
|
+
"unknown"
|
|
29213
|
+
]),
|
|
29214
|
+
following: boolean(),
|
|
29215
|
+
flash: boolean(),
|
|
29216
|
+
lightMode: NavigationLightModeSchema,
|
|
29217
|
+
lightLevel: number().min(40).max(100),
|
|
29218
|
+
/** Ms epoch when the slice was last updated. */
|
|
29219
|
+
lastChangedAt: number()
|
|
29220
|
+
});
|
|
29221
|
+
/**
|
|
29222
|
+
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
29223
|
+
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
29224
|
+
* convention.
|
|
29225
|
+
*/
|
|
29226
|
+
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
29227
|
+
var navigationCapability = {
|
|
29228
|
+
name: "navigation",
|
|
29229
|
+
scope: "device",
|
|
29230
|
+
deviceNative: true,
|
|
29231
|
+
mode: "singleton",
|
|
29232
|
+
deviceTypes: [DeviceType.Camera],
|
|
29233
|
+
deviceConfig: { ui: {
|
|
29234
|
+
kind: "widget",
|
|
29235
|
+
widgetId: "host/navigation-panel",
|
|
29236
|
+
tab: "navigation",
|
|
29237
|
+
topTab: true,
|
|
29238
|
+
label: "Navigation",
|
|
29239
|
+
order: 0
|
|
29240
|
+
} },
|
|
29241
|
+
methods: {
|
|
29242
|
+
/**
|
|
29243
|
+
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
29244
|
+
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
29245
|
+
* path) works for any authenticated user, not admin-only. The UI sends
|
|
29246
|
+
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
29247
|
+
* a single drive write WITHOUT debouncing.
|
|
29248
|
+
*/
|
|
29249
|
+
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29250
|
+
/** Halt all motion immediately (zero drive vector). */
|
|
29251
|
+
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29252
|
+
/** Send the robot to a point on its live map. */
|
|
29253
|
+
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29254
|
+
/**
|
|
29255
|
+
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
29256
|
+
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
29257
|
+
*/
|
|
29258
|
+
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
29259
|
+
/**
|
|
29260
|
+
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
29261
|
+
* unsupported action ids are rejected by the provider.
|
|
29262
|
+
*/
|
|
29263
|
+
runAction: method(object({
|
|
29264
|
+
deviceId: number(),
|
|
29265
|
+
actionId: NavigationActionIdSchema
|
|
29266
|
+
}), _void(), { kind: "mutation" }),
|
|
29267
|
+
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
29268
|
+
playSound: method(object({
|
|
29269
|
+
deviceId: number(),
|
|
29270
|
+
soundId: number().int()
|
|
29271
|
+
}), _void(), { kind: "mutation" }),
|
|
29272
|
+
/**
|
|
29273
|
+
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
29274
|
+
* works anytime, no active stream required).
|
|
29275
|
+
*/
|
|
29276
|
+
setLightOn: method(object({
|
|
29277
|
+
deviceId: number(),
|
|
29278
|
+
on: boolean()
|
|
29279
|
+
}), _void(), { kind: "mutation" }),
|
|
29280
|
+
/**
|
|
29281
|
+
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
29282
|
+
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
29283
|
+
* action that generally needs an active camera stream/monitor session — the
|
|
29284
|
+
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
29285
|
+
*/
|
|
29286
|
+
setLightMode: method(object({
|
|
29287
|
+
deviceId: number(),
|
|
29288
|
+
mode: NavigationLightModeSchema,
|
|
29289
|
+
level: number().min(40).max(100).optional()
|
|
29290
|
+
}), _void(), { kind: "mutation" }),
|
|
29291
|
+
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
29292
|
+
setLightLevel: method(object({
|
|
29293
|
+
deviceId: number(),
|
|
29294
|
+
level: number().min(40).max(100)
|
|
29295
|
+
}), _void(), { kind: "mutation" }),
|
|
29296
|
+
/**
|
|
29297
|
+
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
29298
|
+
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
29299
|
+
* `listActions`).
|
|
29300
|
+
*/
|
|
29301
|
+
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
29302
|
+
},
|
|
29303
|
+
events: { onStatusChanged: { data: object({
|
|
29304
|
+
deviceId: number(),
|
|
29305
|
+
status: NavigationStatusSchema
|
|
29306
|
+
}) } },
|
|
29307
|
+
status: {
|
|
29308
|
+
schema: NavigationStatusSchema,
|
|
29309
|
+
kind: "push"
|
|
29310
|
+
},
|
|
29311
|
+
/**
|
|
29312
|
+
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
29313
|
+
* for live mode / follow / flash changes.
|
|
29314
|
+
*/
|
|
29315
|
+
runtimeState: NavigationRuntimeStateSchema,
|
|
29316
|
+
/**
|
|
29317
|
+
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
29318
|
+
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
29319
|
+
* that. The live handle re-publishes on connect.
|
|
29320
|
+
*
|
|
29321
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
29322
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
29323
|
+
*/
|
|
29324
|
+
durability: "session"
|
|
29325
|
+
};
|
|
28956
29326
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
28957
29327
|
kind: "mutation",
|
|
28958
29328
|
auth: "admin"
|
|
@@ -32228,6 +32598,8 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32228
32598
|
motionTrigger: motionTriggerCapability,
|
|
32229
32599
|
motionZones: motionZonesCapability,
|
|
32230
32600
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32601
|
+
navigation: navigationCapability,
|
|
32602
|
+
networkLink: networkLinkCapability,
|
|
32231
32603
|
notifier: notifierCapability,
|
|
32232
32604
|
numericSensor: numericSensorCapability,
|
|
32233
32605
|
petFeeder: petFeederCapability,
|
|
@@ -36081,6 +36453,66 @@ Object.freeze({
|
|
|
36081
36453
|
addonId: null,
|
|
36082
36454
|
access: "create"
|
|
36083
36455
|
},
|
|
36456
|
+
"navigation.getFeatures": {
|
|
36457
|
+
capName: "navigation",
|
|
36458
|
+
capScope: "device",
|
|
36459
|
+
addonId: null,
|
|
36460
|
+
access: "view"
|
|
36461
|
+
},
|
|
36462
|
+
"navigation.goToPoint": {
|
|
36463
|
+
capName: "navigation",
|
|
36464
|
+
capScope: "device",
|
|
36465
|
+
addonId: null,
|
|
36466
|
+
access: "create"
|
|
36467
|
+
},
|
|
36468
|
+
"navigation.listActions": {
|
|
36469
|
+
capName: "navigation",
|
|
36470
|
+
capScope: "device",
|
|
36471
|
+
addonId: null,
|
|
36472
|
+
access: "view"
|
|
36473
|
+
},
|
|
36474
|
+
"navigation.move": {
|
|
36475
|
+
capName: "navigation",
|
|
36476
|
+
capScope: "device",
|
|
36477
|
+
addonId: null,
|
|
36478
|
+
access: "create"
|
|
36479
|
+
},
|
|
36480
|
+
"navigation.playSound": {
|
|
36481
|
+
capName: "navigation",
|
|
36482
|
+
capScope: "device",
|
|
36483
|
+
addonId: null,
|
|
36484
|
+
access: "create"
|
|
36485
|
+
},
|
|
36486
|
+
"navigation.runAction": {
|
|
36487
|
+
capName: "navigation",
|
|
36488
|
+
capScope: "device",
|
|
36489
|
+
addonId: null,
|
|
36490
|
+
access: "create"
|
|
36491
|
+
},
|
|
36492
|
+
"navigation.setLightLevel": {
|
|
36493
|
+
capName: "navigation",
|
|
36494
|
+
capScope: "device",
|
|
36495
|
+
addonId: null,
|
|
36496
|
+
access: "create"
|
|
36497
|
+
},
|
|
36498
|
+
"navigation.setLightMode": {
|
|
36499
|
+
capName: "navigation",
|
|
36500
|
+
capScope: "device",
|
|
36501
|
+
addonId: null,
|
|
36502
|
+
access: "create"
|
|
36503
|
+
},
|
|
36504
|
+
"navigation.setLightOn": {
|
|
36505
|
+
capName: "navigation",
|
|
36506
|
+
capScope: "device",
|
|
36507
|
+
addonId: null,
|
|
36508
|
+
access: "create"
|
|
36509
|
+
},
|
|
36510
|
+
"navigation.stop": {
|
|
36511
|
+
capName: "navigation",
|
|
36512
|
+
capScope: "device",
|
|
36513
|
+
addonId: null,
|
|
36514
|
+
access: "create"
|
|
36515
|
+
},
|
|
36084
36516
|
"networkAccess.getEndpoint": {
|
|
36085
36517
|
capName: "network-access",
|
|
36086
36518
|
capScope: "system",
|
|
@@ -40176,6 +40608,56 @@ Object.freeze({
|
|
|
40176
40608
|
form: "single",
|
|
40177
40609
|
optional: false
|
|
40178
40610
|
}],
|
|
40611
|
+
"navigation.getFeatures": [{
|
|
40612
|
+
name: "deviceId",
|
|
40613
|
+
form: "single",
|
|
40614
|
+
optional: false
|
|
40615
|
+
}],
|
|
40616
|
+
"navigation.goToPoint": [{
|
|
40617
|
+
name: "deviceId",
|
|
40618
|
+
form: "single",
|
|
40619
|
+
optional: false
|
|
40620
|
+
}],
|
|
40621
|
+
"navigation.listActions": [{
|
|
40622
|
+
name: "deviceId",
|
|
40623
|
+
form: "single",
|
|
40624
|
+
optional: false
|
|
40625
|
+
}],
|
|
40626
|
+
"navigation.move": [{
|
|
40627
|
+
name: "deviceId",
|
|
40628
|
+
form: "single",
|
|
40629
|
+
optional: false
|
|
40630
|
+
}],
|
|
40631
|
+
"navigation.playSound": [{
|
|
40632
|
+
name: "deviceId",
|
|
40633
|
+
form: "single",
|
|
40634
|
+
optional: false
|
|
40635
|
+
}],
|
|
40636
|
+
"navigation.runAction": [{
|
|
40637
|
+
name: "deviceId",
|
|
40638
|
+
form: "single",
|
|
40639
|
+
optional: false
|
|
40640
|
+
}],
|
|
40641
|
+
"navigation.setLightLevel": [{
|
|
40642
|
+
name: "deviceId",
|
|
40643
|
+
form: "single",
|
|
40644
|
+
optional: false
|
|
40645
|
+
}],
|
|
40646
|
+
"navigation.setLightMode": [{
|
|
40647
|
+
name: "deviceId",
|
|
40648
|
+
form: "single",
|
|
40649
|
+
optional: false
|
|
40650
|
+
}],
|
|
40651
|
+
"navigation.setLightOn": [{
|
|
40652
|
+
name: "deviceId",
|
|
40653
|
+
form: "single",
|
|
40654
|
+
optional: false
|
|
40655
|
+
}],
|
|
40656
|
+
"navigation.stop": [{
|
|
40657
|
+
name: "deviceId",
|
|
40658
|
+
form: "single",
|
|
40659
|
+
optional: false
|
|
40660
|
+
}],
|
|
40179
40661
|
"networkQuality.getDeviceStats": [{
|
|
40180
40662
|
name: "deviceId",
|
|
40181
40663
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-matter-broker",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.70",
|
|
4
4
|
"description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|