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