@camstack/addon-terminal 0.1.74 → 0.1.76
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
|
@@ -31,7 +31,7 @@ let node_module = require("node:module");
|
|
|
31
31
|
let sharp = require("sharp");
|
|
32
32
|
sharp = __toESM(sharp);
|
|
33
33
|
let node_http = require("node:http");
|
|
34
|
-
//#region ../types/dist/event-category-
|
|
34
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
35
35
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
36
36
|
EventCategory["SystemBoot"] = "system.boot";
|
|
37
37
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -403,6 +403,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
403
403
|
*/
|
|
404
404
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
405
405
|
/**
|
|
406
|
+
* Cap event fired by every device that registers the `network-link`
|
|
407
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
408
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
409
|
+
* reading that moved.
|
|
410
|
+
*/
|
|
411
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
412
|
+
/**
|
|
406
413
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
407
414
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
408
415
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23915,6 +23922,88 @@ onStatusChanged: { data: object({
|
|
|
23915
23922
|
volatileStateFields: ["lastUpdated"]
|
|
23916
23923
|
};
|
|
23917
23924
|
/**
|
|
23925
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23926
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23927
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23928
|
+
* one Home Assistant projection.
|
|
23929
|
+
*/
|
|
23930
|
+
var NetworkLinkStatusSchema = object({
|
|
23931
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23932
|
+
type: _enum([
|
|
23933
|
+
"wifi",
|
|
23934
|
+
"ethernet",
|
|
23935
|
+
"cellular",
|
|
23936
|
+
"unknown"
|
|
23937
|
+
]),
|
|
23938
|
+
/**
|
|
23939
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23940
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23941
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23942
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23943
|
+
* SKIP a null rather than coerce it.
|
|
23944
|
+
*/
|
|
23945
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23946
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23947
|
+
rssiDbm: number().optional(),
|
|
23948
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23949
|
+
ssid: string().optional(),
|
|
23950
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23951
|
+
lastUpdated: number()
|
|
23952
|
+
});
|
|
23953
|
+
var networkLinkCapability = {
|
|
23954
|
+
name: "network-link",
|
|
23955
|
+
scope: "device",
|
|
23956
|
+
deviceNative: true,
|
|
23957
|
+
mode: "singleton",
|
|
23958
|
+
deviceTypes: [
|
|
23959
|
+
DeviceType.Camera,
|
|
23960
|
+
DeviceType.Sensor,
|
|
23961
|
+
DeviceType.Button,
|
|
23962
|
+
DeviceType.Switch,
|
|
23963
|
+
DeviceType.Light,
|
|
23964
|
+
DeviceType.Lock,
|
|
23965
|
+
DeviceType.Siren
|
|
23966
|
+
],
|
|
23967
|
+
methods: {},
|
|
23968
|
+
events: {
|
|
23969
|
+
/**
|
|
23970
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23971
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23972
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23973
|
+
*/
|
|
23974
|
+
onStatusChanged: { data: object({
|
|
23975
|
+
deviceId: number(),
|
|
23976
|
+
status: NetworkLinkStatusSchema
|
|
23977
|
+
}) } },
|
|
23978
|
+
status: {
|
|
23979
|
+
schema: NetworkLinkStatusSchema,
|
|
23980
|
+
kind: "push",
|
|
23981
|
+
empty: {
|
|
23982
|
+
type: "unknown",
|
|
23983
|
+
signalPercent: null,
|
|
23984
|
+
lastUpdated: 0
|
|
23985
|
+
}
|
|
23986
|
+
},
|
|
23987
|
+
/**
|
|
23988
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23989
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23990
|
+
* Home Assistant projector regardless of the driver.
|
|
23991
|
+
*/
|
|
23992
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23993
|
+
/**
|
|
23994
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23995
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23996
|
+
* restored slice is what the badge shows until the next read.
|
|
23997
|
+
*
|
|
23998
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23999
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
24000
|
+
*/
|
|
24001
|
+
durability: "restored",
|
|
24002
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
24003
|
+
* whether persisting is worth a SQLite commit. */
|
|
24004
|
+
volatileStateFields: ["lastUpdated"]
|
|
24005
|
+
};
|
|
24006
|
+
/**
|
|
23918
24007
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23919
24008
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23920
24009
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -29024,6 +29113,287 @@ var ptzAutotrackCapability = {
|
|
|
29024
29113
|
*/
|
|
29025
29114
|
durability: "session"
|
|
29026
29115
|
};
|
|
29116
|
+
/**
|
|
29117
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
29118
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
29119
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
29120
|
+
*
|
|
29121
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
29122
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
29123
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
29124
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
29125
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
29126
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
29127
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
29128
|
+
* the reverse:
|
|
29129
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
29130
|
+
* / `getOptions`), and
|
|
29131
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
29132
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
29133
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
29134
|
+
* not here (see the addon design note):
|
|
29135
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
29136
|
+
* ptz.stop() → navigation.stop()
|
|
29137
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
29138
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
29139
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
29140
|
+
*
|
|
29141
|
+
* ## Continuous drive
|
|
29142
|
+
*
|
|
29143
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
29144
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
29145
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
29146
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
29147
|
+
* coalesce them. The UI owns the cadence.
|
|
29148
|
+
*
|
|
29149
|
+
* ## The action dictionary
|
|
29150
|
+
*
|
|
29151
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
29152
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
29153
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
29154
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
29155
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
29156
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
29157
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
29158
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
29159
|
+
*
|
|
29160
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
29161
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
29162
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
29163
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
29164
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
29165
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
29166
|
+
* THIS contract.
|
|
29167
|
+
*/
|
|
29168
|
+
/**
|
|
29169
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
29170
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
29171
|
+
* halts it.
|
|
29172
|
+
*
|
|
29173
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
29174
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
29175
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
29176
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
29177
|
+
*
|
|
29178
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
29179
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
29180
|
+
*/
|
|
29181
|
+
var NavigationMoveCommandSchema = object({
|
|
29182
|
+
pan: number().min(-1).max(1).optional(),
|
|
29183
|
+
tilt: number().min(-1).max(1).optional(),
|
|
29184
|
+
speed: number().min(0).max(1).optional()
|
|
29185
|
+
});
|
|
29186
|
+
/**
|
|
29187
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
29188
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
29189
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
29190
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
29191
|
+
*/
|
|
29192
|
+
var NavigationActionIdSchema = _enum([
|
|
29193
|
+
"goHome",
|
|
29194
|
+
"locate",
|
|
29195
|
+
"spotClean",
|
|
29196
|
+
"findPet",
|
|
29197
|
+
"personFollow",
|
|
29198
|
+
"stop",
|
|
29199
|
+
"startClean",
|
|
29200
|
+
"pauseClean",
|
|
29201
|
+
"dockWash",
|
|
29202
|
+
"autoEmpty",
|
|
29203
|
+
"flashOn",
|
|
29204
|
+
"flashOff"
|
|
29205
|
+
]);
|
|
29206
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
29207
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
29208
|
+
/**
|
|
29209
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
29210
|
+
* native panel and the PTZ mimic render as a button.
|
|
29211
|
+
*
|
|
29212
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
29213
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
29214
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
29215
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
29216
|
+
* - `label` — operator-facing English label.
|
|
29217
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
29218
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
29219
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
29220
|
+
* flips it from config, never by editing code.
|
|
29221
|
+
*/
|
|
29222
|
+
var NavigationActionEntrySchema = object({
|
|
29223
|
+
id: string(),
|
|
29224
|
+
kind: NavigationEntryKindSchema,
|
|
29225
|
+
label: string(),
|
|
29226
|
+
icon: string(),
|
|
29227
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
29228
|
+
soundId: number().int().optional(),
|
|
29229
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
29230
|
+
enabled: boolean()
|
|
29231
|
+
});
|
|
29232
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
29233
|
+
var NavigationPointSchema = object({
|
|
29234
|
+
x: number(),
|
|
29235
|
+
y: number()
|
|
29236
|
+
});
|
|
29237
|
+
/**
|
|
29238
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
29239
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
29240
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
29241
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
29242
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
29243
|
+
* that are not dictionary entries.
|
|
29244
|
+
*
|
|
29245
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
29246
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
29247
|
+
* map-coordinate plumbing is wired.
|
|
29248
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
29249
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
29250
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
29251
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
29252
|
+
* camera-service control; needs an active stream).
|
|
29253
|
+
*/
|
|
29254
|
+
var NavigationFeaturesSchema = object({
|
|
29255
|
+
move: boolean(),
|
|
29256
|
+
stop: boolean(),
|
|
29257
|
+
goToPoint: boolean(),
|
|
29258
|
+
runAction: boolean(),
|
|
29259
|
+
playSound: boolean(),
|
|
29260
|
+
light: boolean(),
|
|
29261
|
+
lightMode: boolean()
|
|
29262
|
+
});
|
|
29263
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
29264
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
29265
|
+
/**
|
|
29266
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
29267
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
29268
|
+
* - `following` — person/pet follow is currently armed.
|
|
29269
|
+
* - `flash` — the on-camera fill light is on.
|
|
29270
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
29271
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
29272
|
+
* `lightMode === 'manual'`.
|
|
29273
|
+
*/
|
|
29274
|
+
var NavigationStatusSchema = object({
|
|
29275
|
+
mode: _enum([
|
|
29276
|
+
"idle",
|
|
29277
|
+
"cleaning",
|
|
29278
|
+
"spot",
|
|
29279
|
+
"following",
|
|
29280
|
+
"goto",
|
|
29281
|
+
"returning",
|
|
29282
|
+
"paused",
|
|
29283
|
+
"unknown"
|
|
29284
|
+
]),
|
|
29285
|
+
following: boolean(),
|
|
29286
|
+
flash: boolean(),
|
|
29287
|
+
lightMode: NavigationLightModeSchema,
|
|
29288
|
+
lightLevel: number().min(40).max(100),
|
|
29289
|
+
/** Ms epoch when the slice was last updated. */
|
|
29290
|
+
lastChangedAt: number()
|
|
29291
|
+
});
|
|
29292
|
+
/**
|
|
29293
|
+
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
29294
|
+
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
29295
|
+
* convention.
|
|
29296
|
+
*/
|
|
29297
|
+
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
29298
|
+
var navigationCapability = {
|
|
29299
|
+
name: "navigation",
|
|
29300
|
+
scope: "device",
|
|
29301
|
+
deviceNative: true,
|
|
29302
|
+
mode: "singleton",
|
|
29303
|
+
deviceTypes: [DeviceType.Camera],
|
|
29304
|
+
deviceConfig: { ui: {
|
|
29305
|
+
kind: "widget",
|
|
29306
|
+
widgetId: "host/navigation-panel",
|
|
29307
|
+
tab: "navigation",
|
|
29308
|
+
topTab: true,
|
|
29309
|
+
label: "Navigation",
|
|
29310
|
+
order: 0
|
|
29311
|
+
} },
|
|
29312
|
+
methods: {
|
|
29313
|
+
/**
|
|
29314
|
+
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
29315
|
+
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
29316
|
+
* path) works for any authenticated user, not admin-only. The UI sends
|
|
29317
|
+
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
29318
|
+
* a single drive write WITHOUT debouncing.
|
|
29319
|
+
*/
|
|
29320
|
+
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29321
|
+
/** Halt all motion immediately (zero drive vector). */
|
|
29322
|
+
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29323
|
+
/** Send the robot to a point on its live map. */
|
|
29324
|
+
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29325
|
+
/**
|
|
29326
|
+
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
29327
|
+
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
29328
|
+
*/
|
|
29329
|
+
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
29330
|
+
/**
|
|
29331
|
+
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
29332
|
+
* unsupported action ids are rejected by the provider.
|
|
29333
|
+
*/
|
|
29334
|
+
runAction: method(object({
|
|
29335
|
+
deviceId: number(),
|
|
29336
|
+
actionId: NavigationActionIdSchema
|
|
29337
|
+
}), _void(), { kind: "mutation" }),
|
|
29338
|
+
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
29339
|
+
playSound: method(object({
|
|
29340
|
+
deviceId: number(),
|
|
29341
|
+
soundId: number().int()
|
|
29342
|
+
}), _void(), { kind: "mutation" }),
|
|
29343
|
+
/**
|
|
29344
|
+
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
29345
|
+
* works anytime, no active stream required).
|
|
29346
|
+
*/
|
|
29347
|
+
setLightOn: method(object({
|
|
29348
|
+
deviceId: number(),
|
|
29349
|
+
on: boolean()
|
|
29350
|
+
}), _void(), { kind: "mutation" }),
|
|
29351
|
+
/**
|
|
29352
|
+
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
29353
|
+
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
29354
|
+
* action that generally needs an active camera stream/monitor session — the
|
|
29355
|
+
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
29356
|
+
*/
|
|
29357
|
+
setLightMode: method(object({
|
|
29358
|
+
deviceId: number(),
|
|
29359
|
+
mode: NavigationLightModeSchema,
|
|
29360
|
+
level: number().min(40).max(100).optional()
|
|
29361
|
+
}), _void(), { kind: "mutation" }),
|
|
29362
|
+
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
29363
|
+
setLightLevel: method(object({
|
|
29364
|
+
deviceId: number(),
|
|
29365
|
+
level: number().min(40).max(100)
|
|
29366
|
+
}), _void(), { kind: "mutation" }),
|
|
29367
|
+
/**
|
|
29368
|
+
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
29369
|
+
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
29370
|
+
* `listActions`).
|
|
29371
|
+
*/
|
|
29372
|
+
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
29373
|
+
},
|
|
29374
|
+
events: { onStatusChanged: { data: object({
|
|
29375
|
+
deviceId: number(),
|
|
29376
|
+
status: NavigationStatusSchema
|
|
29377
|
+
}) } },
|
|
29378
|
+
status: {
|
|
29379
|
+
schema: NavigationStatusSchema,
|
|
29380
|
+
kind: "push"
|
|
29381
|
+
},
|
|
29382
|
+
/**
|
|
29383
|
+
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
29384
|
+
* for live mode / follow / flash changes.
|
|
29385
|
+
*/
|
|
29386
|
+
runtimeState: NavigationRuntimeStateSchema,
|
|
29387
|
+
/**
|
|
29388
|
+
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
29389
|
+
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
29390
|
+
* that. The live handle re-publishes on connect.
|
|
29391
|
+
*
|
|
29392
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
29393
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
29394
|
+
*/
|
|
29395
|
+
durability: "session"
|
|
29396
|
+
};
|
|
29027
29397
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
29028
29398
|
kind: "mutation",
|
|
29029
29399
|
auth: "admin"
|
|
@@ -32299,6 +32669,8 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32299
32669
|
motionTrigger: motionTriggerCapability,
|
|
32300
32670
|
motionZones: motionZonesCapability,
|
|
32301
32671
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32672
|
+
navigation: navigationCapability,
|
|
32673
|
+
networkLink: networkLinkCapability,
|
|
32302
32674
|
notifier: notifierCapability,
|
|
32303
32675
|
numericSensor: numericSensorCapability,
|
|
32304
32676
|
petFeeder: petFeederCapability,
|
|
@@ -35785,6 +36157,66 @@ Object.freeze({
|
|
|
35785
36157
|
addonId: null,
|
|
35786
36158
|
access: "create"
|
|
35787
36159
|
},
|
|
36160
|
+
"navigation.getFeatures": {
|
|
36161
|
+
capName: "navigation",
|
|
36162
|
+
capScope: "device",
|
|
36163
|
+
addonId: null,
|
|
36164
|
+
access: "view"
|
|
36165
|
+
},
|
|
36166
|
+
"navigation.goToPoint": {
|
|
36167
|
+
capName: "navigation",
|
|
36168
|
+
capScope: "device",
|
|
36169
|
+
addonId: null,
|
|
36170
|
+
access: "create"
|
|
36171
|
+
},
|
|
36172
|
+
"navigation.listActions": {
|
|
36173
|
+
capName: "navigation",
|
|
36174
|
+
capScope: "device",
|
|
36175
|
+
addonId: null,
|
|
36176
|
+
access: "view"
|
|
36177
|
+
},
|
|
36178
|
+
"navigation.move": {
|
|
36179
|
+
capName: "navigation",
|
|
36180
|
+
capScope: "device",
|
|
36181
|
+
addonId: null,
|
|
36182
|
+
access: "create"
|
|
36183
|
+
},
|
|
36184
|
+
"navigation.playSound": {
|
|
36185
|
+
capName: "navigation",
|
|
36186
|
+
capScope: "device",
|
|
36187
|
+
addonId: null,
|
|
36188
|
+
access: "create"
|
|
36189
|
+
},
|
|
36190
|
+
"navigation.runAction": {
|
|
36191
|
+
capName: "navigation",
|
|
36192
|
+
capScope: "device",
|
|
36193
|
+
addonId: null,
|
|
36194
|
+
access: "create"
|
|
36195
|
+
},
|
|
36196
|
+
"navigation.setLightLevel": {
|
|
36197
|
+
capName: "navigation",
|
|
36198
|
+
capScope: "device",
|
|
36199
|
+
addonId: null,
|
|
36200
|
+
access: "create"
|
|
36201
|
+
},
|
|
36202
|
+
"navigation.setLightMode": {
|
|
36203
|
+
capName: "navigation",
|
|
36204
|
+
capScope: "device",
|
|
36205
|
+
addonId: null,
|
|
36206
|
+
access: "create"
|
|
36207
|
+
},
|
|
36208
|
+
"navigation.setLightOn": {
|
|
36209
|
+
capName: "navigation",
|
|
36210
|
+
capScope: "device",
|
|
36211
|
+
addonId: null,
|
|
36212
|
+
access: "create"
|
|
36213
|
+
},
|
|
36214
|
+
"navigation.stop": {
|
|
36215
|
+
capName: "navigation",
|
|
36216
|
+
capScope: "device",
|
|
36217
|
+
addonId: null,
|
|
36218
|
+
access: "create"
|
|
36219
|
+
},
|
|
35788
36220
|
"networkAccess.getEndpoint": {
|
|
35789
36221
|
capName: "network-access",
|
|
35790
36222
|
capScope: "system",
|
|
@@ -39880,6 +40312,56 @@ Object.freeze({
|
|
|
39880
40312
|
form: "single",
|
|
39881
40313
|
optional: false
|
|
39882
40314
|
}],
|
|
40315
|
+
"navigation.getFeatures": [{
|
|
40316
|
+
name: "deviceId",
|
|
40317
|
+
form: "single",
|
|
40318
|
+
optional: false
|
|
40319
|
+
}],
|
|
40320
|
+
"navigation.goToPoint": [{
|
|
40321
|
+
name: "deviceId",
|
|
40322
|
+
form: "single",
|
|
40323
|
+
optional: false
|
|
40324
|
+
}],
|
|
40325
|
+
"navigation.listActions": [{
|
|
40326
|
+
name: "deviceId",
|
|
40327
|
+
form: "single",
|
|
40328
|
+
optional: false
|
|
40329
|
+
}],
|
|
40330
|
+
"navigation.move": [{
|
|
40331
|
+
name: "deviceId",
|
|
40332
|
+
form: "single",
|
|
40333
|
+
optional: false
|
|
40334
|
+
}],
|
|
40335
|
+
"navigation.playSound": [{
|
|
40336
|
+
name: "deviceId",
|
|
40337
|
+
form: "single",
|
|
40338
|
+
optional: false
|
|
40339
|
+
}],
|
|
40340
|
+
"navigation.runAction": [{
|
|
40341
|
+
name: "deviceId",
|
|
40342
|
+
form: "single",
|
|
40343
|
+
optional: false
|
|
40344
|
+
}],
|
|
40345
|
+
"navigation.setLightLevel": [{
|
|
40346
|
+
name: "deviceId",
|
|
40347
|
+
form: "single",
|
|
40348
|
+
optional: false
|
|
40349
|
+
}],
|
|
40350
|
+
"navigation.setLightMode": [{
|
|
40351
|
+
name: "deviceId",
|
|
40352
|
+
form: "single",
|
|
40353
|
+
optional: false
|
|
40354
|
+
}],
|
|
40355
|
+
"navigation.setLightOn": [{
|
|
40356
|
+
name: "deviceId",
|
|
40357
|
+
form: "single",
|
|
40358
|
+
optional: false
|
|
40359
|
+
}],
|
|
40360
|
+
"navigation.stop": [{
|
|
40361
|
+
name: "deviceId",
|
|
40362
|
+
form: "single",
|
|
40363
|
+
optional: false
|
|
40364
|
+
}],
|
|
39883
40365
|
"networkQuality.getDeviceStats": [{
|
|
39884
40366
|
name: "deviceId",
|
|
39885
40367
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { createServer } from "node:http";
|
|
|
8
8
|
//#region \0rolldown/runtime.js
|
|
9
9
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
10
|
//#endregion
|
|
11
|
-
//#region ../types/dist/event-category-
|
|
11
|
+
//#region ../types/dist/event-category-zAv7pMUz.mjs
|
|
12
12
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
13
13
|
EventCategory["SystemBoot"] = "system.boot";
|
|
14
14
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -380,6 +380,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
380
380
|
*/
|
|
381
381
|
EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
|
|
382
382
|
/**
|
|
383
|
+
* Cap event fired by every device that registers the `network-link`
|
|
384
|
+
* capability. Mirrors the cap definition's `onStatusChanged`. Carries
|
|
385
|
+
* `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
|
|
386
|
+
* reading that moved.
|
|
387
|
+
*/
|
|
388
|
+
EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
|
|
389
|
+
/**
|
|
383
390
|
* Emitted by the battery cap provider WHEN `wakeForStream` enters the
|
|
384
391
|
* "wake in progress" window — between the Baichuan wake-up issue and
|
|
385
392
|
* the camera's first dialed-back RTP packet. The stream-broker
|
|
@@ -23892,6 +23899,88 @@ onStatusChanged: { data: object({
|
|
|
23892
23899
|
volatileStateFields: ["lastUpdated"]
|
|
23893
23900
|
};
|
|
23894
23901
|
/**
|
|
23902
|
+
* Network-link snapshot. Same shape for every provider (a Reolink wifi
|
|
23903
|
+
* camera, a Home Assistant device with a signal-strength sensor, a Tapo
|
|
23904
|
+
* plug): one slice under `device.runtimeState['network-link']`, one badge,
|
|
23905
|
+
* one Home Assistant projection.
|
|
23906
|
+
*/
|
|
23907
|
+
var NetworkLinkStatusSchema = object({
|
|
23908
|
+
/** The link the device is on. `'unknown'` = not read yet, not "no link". */
|
|
23909
|
+
type: _enum([
|
|
23910
|
+
"wifi",
|
|
23911
|
+
"ethernet",
|
|
23912
|
+
"cellular",
|
|
23913
|
+
"unknown"
|
|
23914
|
+
]),
|
|
23915
|
+
/**
|
|
23916
|
+
* Link quality, 0..100 inclusive, normalised by the provider from whatever
|
|
23917
|
+
* the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
|
|
23918
|
+
* KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
|
|
23919
|
+
* one whose reading has not landed must not be drawn at 0 %. Consumers
|
|
23920
|
+
* SKIP a null rather than coerce it.
|
|
23921
|
+
*/
|
|
23922
|
+
signalPercent: number().min(0).max(100).nullable(),
|
|
23923
|
+
/** Raw received signal strength in dBm, when the firmware reports one. */
|
|
23924
|
+
rssiDbm: number().optional(),
|
|
23925
|
+
/** Network name of a wireless link, when the firmware reports it. */
|
|
23926
|
+
ssid: string().optional(),
|
|
23927
|
+
/** Ms epoch of the last observation. Lets consumers reason about freshness. */
|
|
23928
|
+
lastUpdated: number()
|
|
23929
|
+
});
|
|
23930
|
+
var networkLinkCapability = {
|
|
23931
|
+
name: "network-link",
|
|
23932
|
+
scope: "device",
|
|
23933
|
+
deviceNative: true,
|
|
23934
|
+
mode: "singleton",
|
|
23935
|
+
deviceTypes: [
|
|
23936
|
+
DeviceType.Camera,
|
|
23937
|
+
DeviceType.Sensor,
|
|
23938
|
+
DeviceType.Button,
|
|
23939
|
+
DeviceType.Switch,
|
|
23940
|
+
DeviceType.Light,
|
|
23941
|
+
DeviceType.Lock,
|
|
23942
|
+
DeviceType.Siren
|
|
23943
|
+
],
|
|
23944
|
+
methods: {},
|
|
23945
|
+
events: {
|
|
23946
|
+
/**
|
|
23947
|
+
* Emitted whenever the cached status changes (a link switch, a signal
|
|
23948
|
+
* reading that moved). Mirrored on the parent chain by the
|
|
23949
|
+
* DeviceEventPropagator like `battery.onStatusChanged`.
|
|
23950
|
+
*/
|
|
23951
|
+
onStatusChanged: { data: object({
|
|
23952
|
+
deviceId: number(),
|
|
23953
|
+
status: NetworkLinkStatusSchema
|
|
23954
|
+
}) } },
|
|
23955
|
+
status: {
|
|
23956
|
+
schema: NetworkLinkStatusSchema,
|
|
23957
|
+
kind: "push",
|
|
23958
|
+
empty: {
|
|
23959
|
+
type: "unknown",
|
|
23960
|
+
signalPercent: null,
|
|
23961
|
+
lastUpdated: 0
|
|
23962
|
+
}
|
|
23963
|
+
},
|
|
23964
|
+
/**
|
|
23965
|
+
* Runtime-state slice — every provider stores the same shape under
|
|
23966
|
+
* `device.runtimeState['network-link']`, read once by the badge and the
|
|
23967
|
+
* Home Assistant projector regardless of the driver.
|
|
23968
|
+
*/
|
|
23969
|
+
runtimeState: NetworkLinkStatusSchema,
|
|
23970
|
+
/**
|
|
23971
|
+
* Runtime-state durability: **restored** — a link reading is slow to
|
|
23972
|
+
* change and a sleeping battery camera may not report for hours; the
|
|
23973
|
+
* restored slice is what the badge shows until the next read.
|
|
23974
|
+
*
|
|
23975
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
23976
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
23977
|
+
*/
|
|
23978
|
+
durability: "restored",
|
|
23979
|
+
/** Clock fields: written, but excluded from the compare that decides
|
|
23980
|
+
* whether persisting is worth a SQLite commit. */
|
|
23981
|
+
volatileStateFields: ["lastUpdated"]
|
|
23982
|
+
};
|
|
23983
|
+
/**
|
|
23895
23984
|
* Generic boolean sensor — last-resort fallback when no domain-
|
|
23896
23985
|
* specific binary cap fits (Home Assistant `binary_sensor` without a
|
|
23897
23986
|
* known `device_class`, or a domain we haven't typed yet). Pure
|
|
@@ -29001,6 +29090,287 @@ var ptzAutotrackCapability = {
|
|
|
29001
29090
|
*/
|
|
29002
29091
|
durability: "session"
|
|
29003
29092
|
};
|
|
29093
|
+
/**
|
|
29094
|
+
* `navigation` — a device-scoped capability that natively expresses the FULL
|
|
29095
|
+
* navigation / action surface of a robot that DRIVES ITSELF and carries an
|
|
29096
|
+
* on-board camera (the Dreame robot-vacuum camera is the first provider).
|
|
29097
|
+
*
|
|
29098
|
+
* Why a NEW cap rather than overloading `ptz`:
|
|
29099
|
+
* - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
|
|
29100
|
+
* robot vacuum has no gimbal — the whole chassis drives, turns and spins.
|
|
29101
|
+
* The two are different physical models: PTZ is absolute-position + presets,
|
|
29102
|
+
* navigation is momentary drive nudges + discrete robot ACTIONS
|
|
29103
|
+
* (dock / spot-clean / follow-pet / go-to-point / …).
|
|
29104
|
+
* - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
|
|
29105
|
+
* the reverse:
|
|
29106
|
+
* 1. a native CamStack navigation panel (data-driven from `listActions`
|
|
29107
|
+
* / `getOptions`), and
|
|
29108
|
+
* 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
|
|
29109
|
+
* robot camera shows up in the existing PTZ control path without every
|
|
29110
|
+
* PTZ provider learning about robots. The mapping lives in the adapter,
|
|
29111
|
+
* not here (see the addon design note):
|
|
29112
|
+
* ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
|
|
29113
|
+
* ptz.stop() → navigation.stop()
|
|
29114
|
+
* ptz.goHome() → navigation.runAction('goHome')
|
|
29115
|
+
* ptz.getPresets() → navigation.listActions() (id→preset)
|
|
29116
|
+
* ptz.goToPreset(id) → navigation.runAction(id)
|
|
29117
|
+
*
|
|
29118
|
+
* ## Continuous drive
|
|
29119
|
+
*
|
|
29120
|
+
* `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
|
|
29121
|
+
* sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
|
|
29122
|
+
* one `stop()` on release — exactly like the robot app's remote-drive joystick.
|
|
29123
|
+
* The provider forwards EACH `move` to one drive write; it must NOT debounce or
|
|
29124
|
+
* coalesce them. The UI owns the cadence.
|
|
29125
|
+
*
|
|
29126
|
+
* ## The action dictionary
|
|
29127
|
+
*
|
|
29128
|
+
* The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
|
|
29129
|
+
* are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
|
|
29130
|
+
* carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
|
|
29131
|
+
* native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
|
|
29132
|
+
* vendor-specific list. `kind: 'action'` entries are triggered with
|
|
29133
|
+
* `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
|
|
29134
|
+
* (the entry carries the `soundId` to pass). The general primitives — `move`,
|
|
29135
|
+
* `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
|
|
29136
|
+
*
|
|
29137
|
+
* NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
|
|
29138
|
+
* `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
|
|
29139
|
+
* that the currently-published `@apocaliss92/nodedreame` already exposes on
|
|
29140
|
+
* every device handle. A future nodedreame publish adds a typed
|
|
29141
|
+
* `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
|
|
29142
|
+
* provider can then swap the raw calls for the typed methods with no change to
|
|
29143
|
+
* THIS contract.
|
|
29144
|
+
*/
|
|
29145
|
+
/**
|
|
29146
|
+
* A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
|
|
29147
|
+
* keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
|
|
29148
|
+
* halts it.
|
|
29149
|
+
*
|
|
29150
|
+
* - `pan` — turn: negative = left, positive = right, 0 = straight.
|
|
29151
|
+
* - `tilt` — throttle: positive = forward, negative = spin / turn-around.
|
|
29152
|
+
* - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
|
|
29153
|
+
* vector by it (drivers without proportional drive ignore it).
|
|
29154
|
+
*
|
|
29155
|
+
* `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
|
|
29156
|
+
* axis alone; an all-undefined nudge is a no-op.
|
|
29157
|
+
*/
|
|
29158
|
+
var NavigationMoveCommandSchema = object({
|
|
29159
|
+
pan: number().min(-1).max(1).optional(),
|
|
29160
|
+
tilt: number().min(-1).max(1).optional(),
|
|
29161
|
+
speed: number().min(0).max(1).optional()
|
|
29162
|
+
});
|
|
29163
|
+
/**
|
|
29164
|
+
* The enumerated discrete actions a navigation-capable robot can perform via
|
|
29165
|
+
* `runAction`. This is the CLOSED vocabulary; a given device advertises the
|
|
29166
|
+
* subset it supports through `listActions`. Sounds are NOT here — they go through
|
|
29167
|
+
* `playSound` (see the `sound` dictionary entries).
|
|
29168
|
+
*/
|
|
29169
|
+
var NavigationActionIdSchema = _enum([
|
|
29170
|
+
"goHome",
|
|
29171
|
+
"locate",
|
|
29172
|
+
"spotClean",
|
|
29173
|
+
"findPet",
|
|
29174
|
+
"personFollow",
|
|
29175
|
+
"stop",
|
|
29176
|
+
"startClean",
|
|
29177
|
+
"pauseClean",
|
|
29178
|
+
"dockWash",
|
|
29179
|
+
"autoEmpty",
|
|
29180
|
+
"flashOn",
|
|
29181
|
+
"flashOff"
|
|
29182
|
+
]);
|
|
29183
|
+
/** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
|
|
29184
|
+
var NavigationEntryKindSchema = _enum(["action", "sound"]);
|
|
29185
|
+
/**
|
|
29186
|
+
* One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
|
|
29187
|
+
* native panel and the PTZ mimic render as a button.
|
|
29188
|
+
*
|
|
29189
|
+
* - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
|
|
29190
|
+
* (pass to `runAction`); for `kind:'sound'` it is a namespaced id
|
|
29191
|
+
* (`sound:meow`) whose `soundId` is passed to `playSound`.
|
|
29192
|
+
* - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
|
|
29193
|
+
* - `label` — operator-facing English label.
|
|
29194
|
+
* - `soundId` — wire sound id, present only on `kind:'sound'` entries.
|
|
29195
|
+
* - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
|
|
29196
|
+
* PTZ render ONLY enabled entries. Data-driven: the provider
|
|
29197
|
+
* flips it from config, never by editing code.
|
|
29198
|
+
*/
|
|
29199
|
+
var NavigationActionEntrySchema = object({
|
|
29200
|
+
id: string(),
|
|
29201
|
+
kind: NavigationEntryKindSchema,
|
|
29202
|
+
label: string(),
|
|
29203
|
+
icon: string(),
|
|
29204
|
+
/** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
|
|
29205
|
+
soundId: number().int().optional(),
|
|
29206
|
+
/** Per-device feature flag — render this entry only when true. */
|
|
29207
|
+
enabled: boolean()
|
|
29208
|
+
});
|
|
29209
|
+
/** Coordinates for `goToPoint` — a point on the robot's live map. */
|
|
29210
|
+
var NavigationPointSchema = object({
|
|
29211
|
+
x: number(),
|
|
29212
|
+
y: number()
|
|
29213
|
+
});
|
|
29214
|
+
/**
|
|
29215
|
+
* Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
|
|
29216
|
+
* The cap reports which are enabled so the UI / PTZ render only the controls
|
|
29217
|
+
* that are turned on for THIS device. Data-driven: the provider derives these
|
|
29218
|
+
* from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
|
|
29219
|
+
* live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
|
|
29220
|
+
* that are not dictionary entries.
|
|
29221
|
+
*
|
|
29222
|
+
* - `move` / `stop` — the momentary drive joystick.
|
|
29223
|
+
* - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
|
|
29224
|
+
* map-coordinate plumbing is wired.
|
|
29225
|
+
* - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
|
|
29226
|
+
* - `playSound` — the sound buttons (dictionary `kind:'sound'`).
|
|
29227
|
+
* - `light` — the on/off fill-light toggle (works anytime).
|
|
29228
|
+
* - `lightMode` — the auto/manual selector + manual level slider (a
|
|
29229
|
+
* camera-service control; needs an active stream).
|
|
29230
|
+
*/
|
|
29231
|
+
var NavigationFeaturesSchema = object({
|
|
29232
|
+
move: boolean(),
|
|
29233
|
+
stop: boolean(),
|
|
29234
|
+
goToPoint: boolean(),
|
|
29235
|
+
runAction: boolean(),
|
|
29236
|
+
playSound: boolean(),
|
|
29237
|
+
light: boolean(),
|
|
29238
|
+
lightMode: boolean()
|
|
29239
|
+
});
|
|
29240
|
+
/** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
|
|
29241
|
+
var NavigationLightModeSchema = _enum(["auto", "manual"]);
|
|
29242
|
+
/**
|
|
29243
|
+
* Live navigation state so the UI can reflect what the robot is doing:
|
|
29244
|
+
* - `mode` — coarse activity (idle / cleaning / following / …).
|
|
29245
|
+
* - `following` — person/pet follow is currently armed.
|
|
29246
|
+
* - `flash` — the on-camera fill light is on.
|
|
29247
|
+
* - `lightMode` — auto vs manual fill-light mode.
|
|
29248
|
+
* - `lightLevel` — manual fill-light level (40..100); meaningful when
|
|
29249
|
+
* `lightMode === 'manual'`.
|
|
29250
|
+
*/
|
|
29251
|
+
var NavigationStatusSchema = object({
|
|
29252
|
+
mode: _enum([
|
|
29253
|
+
"idle",
|
|
29254
|
+
"cleaning",
|
|
29255
|
+
"spot",
|
|
29256
|
+
"following",
|
|
29257
|
+
"goto",
|
|
29258
|
+
"returning",
|
|
29259
|
+
"paused",
|
|
29260
|
+
"unknown"
|
|
29261
|
+
]),
|
|
29262
|
+
following: boolean(),
|
|
29263
|
+
flash: boolean(),
|
|
29264
|
+
lightMode: NavigationLightModeSchema,
|
|
29265
|
+
lightLevel: number().min(40).max(100),
|
|
29266
|
+
/** Ms epoch when the slice was last updated. */
|
|
29267
|
+
lastChangedAt: number()
|
|
29268
|
+
});
|
|
29269
|
+
/**
|
|
29270
|
+
* Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
|
|
29271
|
+
* observable). Adds `lastFetchedAt` on top of the status shape per the
|
|
29272
|
+
* convention.
|
|
29273
|
+
*/
|
|
29274
|
+
var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
|
|
29275
|
+
var navigationCapability = {
|
|
29276
|
+
name: "navigation",
|
|
29277
|
+
scope: "device",
|
|
29278
|
+
deviceNative: true,
|
|
29279
|
+
mode: "singleton",
|
|
29280
|
+
deviceTypes: [DeviceType.Camera],
|
|
29281
|
+
deviceConfig: { ui: {
|
|
29282
|
+
kind: "widget",
|
|
29283
|
+
widgetId: "host/navigation-panel",
|
|
29284
|
+
tab: "navigation",
|
|
29285
|
+
topTab: true,
|
|
29286
|
+
label: "Navigation",
|
|
29287
|
+
order: 0
|
|
29288
|
+
} },
|
|
29289
|
+
methods: {
|
|
29290
|
+
/**
|
|
29291
|
+
* Momentary drive nudge (the robot moves). `protected` — mirrors
|
|
29292
|
+
* `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
|
|
29293
|
+
* path) works for any authenticated user, not admin-only. The UI sends
|
|
29294
|
+
* these at ~1 Hz while a control is held; the provider forwards each one to
|
|
29295
|
+
* a single drive write WITHOUT debouncing.
|
|
29296
|
+
*/
|
|
29297
|
+
move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29298
|
+
/** Halt all motion immediately (zero drive vector). */
|
|
29299
|
+
stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29300
|
+
/** Send the robot to a point on its live map. */
|
|
29301
|
+
goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
|
|
29302
|
+
/**
|
|
29303
|
+
* Enumerate the discrete controls THIS device supports (data-driven UI +
|
|
29304
|
+
* PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
|
|
29305
|
+
*/
|
|
29306
|
+
listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
|
|
29307
|
+
/**
|
|
29308
|
+
* Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
|
|
29309
|
+
* unsupported action ids are rejected by the provider.
|
|
29310
|
+
*/
|
|
29311
|
+
runAction: method(object({
|
|
29312
|
+
deviceId: number(),
|
|
29313
|
+
actionId: NavigationActionIdSchema
|
|
29314
|
+
}), _void(), { kind: "mutation" }),
|
|
29315
|
+
/** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
|
|
29316
|
+
playSound: method(object({
|
|
29317
|
+
deviceId: number(),
|
|
29318
|
+
soundId: number().int()
|
|
29319
|
+
}), _void(), { kind: "mutation" }),
|
|
29320
|
+
/**
|
|
29321
|
+
* Turn the on-camera fill light on / off (the `OpenFullLight` control —
|
|
29322
|
+
* works anytime, no active stream required).
|
|
29323
|
+
*/
|
|
29324
|
+
setLightOn: method(object({
|
|
29325
|
+
deviceId: number(),
|
|
29326
|
+
on: boolean()
|
|
29327
|
+
}), _void(), { kind: "mutation" }),
|
|
29328
|
+
/**
|
|
29329
|
+
* Set the fill-light mode (auto vs manual). `manual` optionally carries the
|
|
29330
|
+
* initial `level`. The auto/manual + level control is a CAMERA-service
|
|
29331
|
+
* action that generally needs an active camera stream/monitor session — the
|
|
29332
|
+
* UI shows the manual level slider ONLY when `mode === 'manual'`.
|
|
29333
|
+
*/
|
|
29334
|
+
setLightMode: method(object({
|
|
29335
|
+
deviceId: number(),
|
|
29336
|
+
mode: NavigationLightModeSchema,
|
|
29337
|
+
level: number().min(40).max(100).optional()
|
|
29338
|
+
}), _void(), { kind: "mutation" }),
|
|
29339
|
+
/** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
|
|
29340
|
+
setLightLevel: method(object({
|
|
29341
|
+
deviceId: number(),
|
|
29342
|
+
level: number().min(40).max(100)
|
|
29343
|
+
}), _void(), { kind: "mutation" }),
|
|
29344
|
+
/**
|
|
29345
|
+
* Per-device FEATURE-FLAG report for the general primitives — drives which
|
|
29346
|
+
* controls the UI shows (the per-entry flags for the dictionary come back on
|
|
29347
|
+
* `listActions`).
|
|
29348
|
+
*/
|
|
29349
|
+
getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
|
|
29350
|
+
},
|
|
29351
|
+
events: { onStatusChanged: { data: object({
|
|
29352
|
+
deviceId: number(),
|
|
29353
|
+
status: NavigationStatusSchema
|
|
29354
|
+
}) } },
|
|
29355
|
+
status: {
|
|
29356
|
+
schema: NavigationStatusSchema,
|
|
29357
|
+
kind: "push"
|
|
29358
|
+
},
|
|
29359
|
+
/**
|
|
29360
|
+
* Runtime-state slice mirrored by the kernel. The navigation panel watches it
|
|
29361
|
+
* for live mode / follow / flash changes.
|
|
29362
|
+
*/
|
|
29363
|
+
runtimeState: NavigationRuntimeStateSchema,
|
|
29364
|
+
/**
|
|
29365
|
+
* Runtime-state durability: **session** — like `vacuum-control`, a restored
|
|
29366
|
+
* `mode: cleaning` / `following: true` is a robot that is not actually doing
|
|
29367
|
+
* that. The live handle re-publishes on connect.
|
|
29368
|
+
*
|
|
29369
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
29370
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
29371
|
+
*/
|
|
29372
|
+
durability: "session"
|
|
29373
|
+
};
|
|
29004
29374
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
29005
29375
|
kind: "mutation",
|
|
29006
29376
|
auth: "admin"
|
|
@@ -32276,6 +32646,8 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
32276
32646
|
motionTrigger: motionTriggerCapability,
|
|
32277
32647
|
motionZones: motionZonesCapability,
|
|
32278
32648
|
nativeObjectDetection: nativeObjectDetectionCapability,
|
|
32649
|
+
navigation: navigationCapability,
|
|
32650
|
+
networkLink: networkLinkCapability,
|
|
32279
32651
|
notifier: notifierCapability,
|
|
32280
32652
|
numericSensor: numericSensorCapability,
|
|
32281
32653
|
petFeeder: petFeederCapability,
|
|
@@ -35762,6 +36134,66 @@ Object.freeze({
|
|
|
35762
36134
|
addonId: null,
|
|
35763
36135
|
access: "create"
|
|
35764
36136
|
},
|
|
36137
|
+
"navigation.getFeatures": {
|
|
36138
|
+
capName: "navigation",
|
|
36139
|
+
capScope: "device",
|
|
36140
|
+
addonId: null,
|
|
36141
|
+
access: "view"
|
|
36142
|
+
},
|
|
36143
|
+
"navigation.goToPoint": {
|
|
36144
|
+
capName: "navigation",
|
|
36145
|
+
capScope: "device",
|
|
36146
|
+
addonId: null,
|
|
36147
|
+
access: "create"
|
|
36148
|
+
},
|
|
36149
|
+
"navigation.listActions": {
|
|
36150
|
+
capName: "navigation",
|
|
36151
|
+
capScope: "device",
|
|
36152
|
+
addonId: null,
|
|
36153
|
+
access: "view"
|
|
36154
|
+
},
|
|
36155
|
+
"navigation.move": {
|
|
36156
|
+
capName: "navigation",
|
|
36157
|
+
capScope: "device",
|
|
36158
|
+
addonId: null,
|
|
36159
|
+
access: "create"
|
|
36160
|
+
},
|
|
36161
|
+
"navigation.playSound": {
|
|
36162
|
+
capName: "navigation",
|
|
36163
|
+
capScope: "device",
|
|
36164
|
+
addonId: null,
|
|
36165
|
+
access: "create"
|
|
36166
|
+
},
|
|
36167
|
+
"navigation.runAction": {
|
|
36168
|
+
capName: "navigation",
|
|
36169
|
+
capScope: "device",
|
|
36170
|
+
addonId: null,
|
|
36171
|
+
access: "create"
|
|
36172
|
+
},
|
|
36173
|
+
"navigation.setLightLevel": {
|
|
36174
|
+
capName: "navigation",
|
|
36175
|
+
capScope: "device",
|
|
36176
|
+
addonId: null,
|
|
36177
|
+
access: "create"
|
|
36178
|
+
},
|
|
36179
|
+
"navigation.setLightMode": {
|
|
36180
|
+
capName: "navigation",
|
|
36181
|
+
capScope: "device",
|
|
36182
|
+
addonId: null,
|
|
36183
|
+
access: "create"
|
|
36184
|
+
},
|
|
36185
|
+
"navigation.setLightOn": {
|
|
36186
|
+
capName: "navigation",
|
|
36187
|
+
capScope: "device",
|
|
36188
|
+
addonId: null,
|
|
36189
|
+
access: "create"
|
|
36190
|
+
},
|
|
36191
|
+
"navigation.stop": {
|
|
36192
|
+
capName: "navigation",
|
|
36193
|
+
capScope: "device",
|
|
36194
|
+
addonId: null,
|
|
36195
|
+
access: "create"
|
|
36196
|
+
},
|
|
35765
36197
|
"networkAccess.getEndpoint": {
|
|
35766
36198
|
capName: "network-access",
|
|
35767
36199
|
capScope: "system",
|
|
@@ -39857,6 +40289,56 @@ Object.freeze({
|
|
|
39857
40289
|
form: "single",
|
|
39858
40290
|
optional: false
|
|
39859
40291
|
}],
|
|
40292
|
+
"navigation.getFeatures": [{
|
|
40293
|
+
name: "deviceId",
|
|
40294
|
+
form: "single",
|
|
40295
|
+
optional: false
|
|
40296
|
+
}],
|
|
40297
|
+
"navigation.goToPoint": [{
|
|
40298
|
+
name: "deviceId",
|
|
40299
|
+
form: "single",
|
|
40300
|
+
optional: false
|
|
40301
|
+
}],
|
|
40302
|
+
"navigation.listActions": [{
|
|
40303
|
+
name: "deviceId",
|
|
40304
|
+
form: "single",
|
|
40305
|
+
optional: false
|
|
40306
|
+
}],
|
|
40307
|
+
"navigation.move": [{
|
|
40308
|
+
name: "deviceId",
|
|
40309
|
+
form: "single",
|
|
40310
|
+
optional: false
|
|
40311
|
+
}],
|
|
40312
|
+
"navigation.playSound": [{
|
|
40313
|
+
name: "deviceId",
|
|
40314
|
+
form: "single",
|
|
40315
|
+
optional: false
|
|
40316
|
+
}],
|
|
40317
|
+
"navigation.runAction": [{
|
|
40318
|
+
name: "deviceId",
|
|
40319
|
+
form: "single",
|
|
40320
|
+
optional: false
|
|
40321
|
+
}],
|
|
40322
|
+
"navigation.setLightLevel": [{
|
|
40323
|
+
name: "deviceId",
|
|
40324
|
+
form: "single",
|
|
40325
|
+
optional: false
|
|
40326
|
+
}],
|
|
40327
|
+
"navigation.setLightMode": [{
|
|
40328
|
+
name: "deviceId",
|
|
40329
|
+
form: "single",
|
|
40330
|
+
optional: false
|
|
40331
|
+
}],
|
|
40332
|
+
"navigation.setLightOn": [{
|
|
40333
|
+
name: "deviceId",
|
|
40334
|
+
form: "single",
|
|
40335
|
+
optional: false
|
|
40336
|
+
}],
|
|
40337
|
+
"navigation.stop": [{
|
|
40338
|
+
name: "deviceId",
|
|
40339
|
+
form: "single",
|
|
40340
|
+
optional: false
|
|
40341
|
+
}],
|
|
39860
40342
|
"networkQuality.getDeviceStats": [{
|
|
39861
40343
|
name: "deviceId",
|
|
39862
40344
|
form: "single",
|