@camstack/addon-provider-velux 0.2.70 → 0.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 CHANGED
@@ -5406,6 +5406,12 @@ Object.fromEntries([
5406
5406
  icon: "move",
5407
5407
  order: 40
5408
5408
  },
5409
+ {
5410
+ id: "navigation",
5411
+ label: "Navigation",
5412
+ icon: "compass",
5413
+ order: 41
5414
+ },
5409
5415
  {
5410
5416
  id: "consumables",
5411
5417
  label: "Consumables",
@@ -28947,6 +28953,287 @@ var ptzAutotrackCapability = {
28947
28953
  */
28948
28954
  durability: "session"
28949
28955
  };
28956
+ /**
28957
+ * `navigation` — a device-scoped capability that natively expresses the FULL
28958
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
28959
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
28960
+ *
28961
+ * Why a NEW cap rather than overloading `ptz`:
28962
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
28963
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
28964
+ * The two are different physical models: PTZ is absolute-position + presets,
28965
+ * navigation is momentary drive nudges + discrete robot ACTIONS
28966
+ * (dock / spot-clean / follow-pet / go-to-point / …).
28967
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
28968
+ * the reverse:
28969
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
28970
+ * / `getOptions`), and
28971
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
28972
+ * robot camera shows up in the existing PTZ control path without every
28973
+ * PTZ provider learning about robots. The mapping lives in the adapter,
28974
+ * not here (see the addon design note):
28975
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
28976
+ * ptz.stop() → navigation.stop()
28977
+ * ptz.goHome() → navigation.runAction('goHome')
28978
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28979
+ * ptz.goToPreset(id) → navigation.runAction(id)
28980
+ *
28981
+ * ## Continuous drive
28982
+ *
28983
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28984
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28985
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28986
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28987
+ * coalesce them. The UI owns the cadence.
28988
+ *
28989
+ * ## The action dictionary
28990
+ *
28991
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
28992
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
28993
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
28994
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
28995
+ * vendor-specific list. `kind: 'action'` entries are triggered with
28996
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
28997
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
28998
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
28999
+ *
29000
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29001
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29002
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29003
+ * every device handle. A future nodedreame publish adds a typed
29004
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29005
+ * provider can then swap the raw calls for the typed methods with no change to
29006
+ * THIS contract.
29007
+ */
29008
+ /**
29009
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29010
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29011
+ * halts it.
29012
+ *
29013
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29014
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29015
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29016
+ * vector by it (drivers without proportional drive ignore it).
29017
+ *
29018
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29019
+ * axis alone; an all-undefined nudge is a no-op.
29020
+ */
29021
+ var NavigationMoveCommandSchema = object({
29022
+ pan: number().min(-1).max(1).optional(),
29023
+ tilt: number().min(-1).max(1).optional(),
29024
+ speed: number().min(0).max(1).optional()
29025
+ });
29026
+ /**
29027
+ * The enumerated discrete actions a navigation-capable robot can perform via
29028
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29029
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29030
+ * `playSound` (see the `sound` dictionary entries).
29031
+ */
29032
+ var NavigationActionIdSchema = _enum([
29033
+ "goHome",
29034
+ "locate",
29035
+ "spotClean",
29036
+ "findPet",
29037
+ "personFollow",
29038
+ "stop",
29039
+ "startClean",
29040
+ "pauseClean",
29041
+ "dockWash",
29042
+ "autoEmpty",
29043
+ "flashOn",
29044
+ "flashOff"
29045
+ ]);
29046
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29047
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29048
+ /**
29049
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29050
+ * native panel and the PTZ mimic render as a button.
29051
+ *
29052
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29053
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29054
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29055
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29056
+ * - `label` — operator-facing English label.
29057
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29058
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29059
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29060
+ * flips it from config, never by editing code.
29061
+ */
29062
+ var NavigationActionEntrySchema = object({
29063
+ id: string(),
29064
+ kind: NavigationEntryKindSchema,
29065
+ label: string(),
29066
+ icon: string(),
29067
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29068
+ soundId: number().int().optional(),
29069
+ /** Per-device feature flag — render this entry only when true. */
29070
+ enabled: boolean()
29071
+ });
29072
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29073
+ var NavigationPointSchema = object({
29074
+ x: number(),
29075
+ y: number()
29076
+ });
29077
+ /**
29078
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29079
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29080
+ * that are turned on for THIS device. Data-driven: the provider derives these
29081
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29082
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29083
+ * that are not dictionary entries.
29084
+ *
29085
+ * - `move` / `stop` — the momentary drive joystick.
29086
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29087
+ * map-coordinate plumbing is wired.
29088
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29089
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29090
+ * - `light` — the on/off fill-light toggle (works anytime).
29091
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29092
+ * camera-service control; needs an active stream).
29093
+ */
29094
+ var NavigationFeaturesSchema = object({
29095
+ move: boolean(),
29096
+ stop: boolean(),
29097
+ goToPoint: boolean(),
29098
+ runAction: boolean(),
29099
+ playSound: boolean(),
29100
+ light: boolean(),
29101
+ lightMode: boolean()
29102
+ });
29103
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29104
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29105
+ /**
29106
+ * Live navigation state so the UI can reflect what the robot is doing:
29107
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29108
+ * - `following` — person/pet follow is currently armed.
29109
+ * - `flash` — the on-camera fill light is on.
29110
+ * - `lightMode` — auto vs manual fill-light mode.
29111
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29112
+ * `lightMode === 'manual'`.
29113
+ */
29114
+ var NavigationStatusSchema = object({
29115
+ mode: _enum([
29116
+ "idle",
29117
+ "cleaning",
29118
+ "spot",
29119
+ "following",
29120
+ "goto",
29121
+ "returning",
29122
+ "paused",
29123
+ "unknown"
29124
+ ]),
29125
+ following: boolean(),
29126
+ flash: boolean(),
29127
+ lightMode: NavigationLightModeSchema,
29128
+ lightLevel: number().min(40).max(100),
29129
+ /** Ms epoch when the slice was last updated. */
29130
+ lastChangedAt: number()
29131
+ });
29132
+ /**
29133
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29134
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29135
+ * convention.
29136
+ */
29137
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29138
+ var navigationCapability = {
29139
+ name: "navigation",
29140
+ scope: "device",
29141
+ deviceNative: true,
29142
+ mode: "singleton",
29143
+ deviceTypes: [DeviceType.Camera],
29144
+ deviceConfig: { ui: {
29145
+ kind: "widget",
29146
+ widgetId: "host/navigation-panel",
29147
+ tab: "navigation",
29148
+ topTab: true,
29149
+ label: "Navigation",
29150
+ order: 0
29151
+ } },
29152
+ methods: {
29153
+ /**
29154
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29155
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29156
+ * path) works for any authenticated user, not admin-only. The UI sends
29157
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29158
+ * a single drive write WITHOUT debouncing.
29159
+ */
29160
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29161
+ /** Halt all motion immediately (zero drive vector). */
29162
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29163
+ /** Send the robot to a point on its live map. */
29164
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29165
+ /**
29166
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29167
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29168
+ */
29169
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29170
+ /**
29171
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29172
+ * unsupported action ids are rejected by the provider.
29173
+ */
29174
+ runAction: method(object({
29175
+ deviceId: number(),
29176
+ actionId: NavigationActionIdSchema
29177
+ }), _void(), { kind: "mutation" }),
29178
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29179
+ playSound: method(object({
29180
+ deviceId: number(),
29181
+ soundId: number().int()
29182
+ }), _void(), { kind: "mutation" }),
29183
+ /**
29184
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29185
+ * works anytime, no active stream required).
29186
+ */
29187
+ setLightOn: method(object({
29188
+ deviceId: number(),
29189
+ on: boolean()
29190
+ }), _void(), { kind: "mutation" }),
29191
+ /**
29192
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29193
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29194
+ * action that generally needs an active camera stream/monitor session — the
29195
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29196
+ */
29197
+ setLightMode: method(object({
29198
+ deviceId: number(),
29199
+ mode: NavigationLightModeSchema,
29200
+ level: number().min(40).max(100).optional()
29201
+ }), _void(), { kind: "mutation" }),
29202
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29203
+ setLightLevel: method(object({
29204
+ deviceId: number(),
29205
+ level: number().min(40).max(100)
29206
+ }), _void(), { kind: "mutation" }),
29207
+ /**
29208
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29209
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29210
+ * `listActions`).
29211
+ */
29212
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29213
+ },
29214
+ events: { onStatusChanged: { data: object({
29215
+ deviceId: number(),
29216
+ status: NavigationStatusSchema
29217
+ }) } },
29218
+ status: {
29219
+ schema: NavigationStatusSchema,
29220
+ kind: "push"
29221
+ },
29222
+ /**
29223
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29224
+ * for live mode / follow / flash changes.
29225
+ */
29226
+ runtimeState: NavigationRuntimeStateSchema,
29227
+ /**
29228
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29229
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29230
+ * that. The live handle re-publishes on connect.
29231
+ *
29232
+ * See `RuntimeStateDurability`. Enforced by
29233
+ * `scripts/check-runtime-state-durability.ts`.
29234
+ */
29235
+ durability: "session"
29236
+ };
28950
29237
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
28951
29238
  kind: "mutation",
28952
29239
  auth: "admin"
@@ -32222,6 +32509,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32222
32509
  motionTrigger: motionTriggerCapability,
32223
32510
  motionZones: motionZonesCapability,
32224
32511
  nativeObjectDetection: nativeObjectDetectionCapability,
32512
+ navigation: navigationCapability,
32225
32513
  networkLink: networkLinkCapability,
32226
32514
  notifier: notifierCapability,
32227
32515
  numericSensor: numericSensorCapability,
@@ -36076,6 +36364,66 @@ Object.freeze({
36076
36364
  addonId: null,
36077
36365
  access: "create"
36078
36366
  },
36367
+ "navigation.getFeatures": {
36368
+ capName: "navigation",
36369
+ capScope: "device",
36370
+ addonId: null,
36371
+ access: "view"
36372
+ },
36373
+ "navigation.goToPoint": {
36374
+ capName: "navigation",
36375
+ capScope: "device",
36376
+ addonId: null,
36377
+ access: "create"
36378
+ },
36379
+ "navigation.listActions": {
36380
+ capName: "navigation",
36381
+ capScope: "device",
36382
+ addonId: null,
36383
+ access: "view"
36384
+ },
36385
+ "navigation.move": {
36386
+ capName: "navigation",
36387
+ capScope: "device",
36388
+ addonId: null,
36389
+ access: "create"
36390
+ },
36391
+ "navigation.playSound": {
36392
+ capName: "navigation",
36393
+ capScope: "device",
36394
+ addonId: null,
36395
+ access: "create"
36396
+ },
36397
+ "navigation.runAction": {
36398
+ capName: "navigation",
36399
+ capScope: "device",
36400
+ addonId: null,
36401
+ access: "create"
36402
+ },
36403
+ "navigation.setLightLevel": {
36404
+ capName: "navigation",
36405
+ capScope: "device",
36406
+ addonId: null,
36407
+ access: "create"
36408
+ },
36409
+ "navigation.setLightMode": {
36410
+ capName: "navigation",
36411
+ capScope: "device",
36412
+ addonId: null,
36413
+ access: "create"
36414
+ },
36415
+ "navigation.setLightOn": {
36416
+ capName: "navigation",
36417
+ capScope: "device",
36418
+ addonId: null,
36419
+ access: "create"
36420
+ },
36421
+ "navigation.stop": {
36422
+ capName: "navigation",
36423
+ capScope: "device",
36424
+ addonId: null,
36425
+ access: "create"
36426
+ },
36079
36427
  "networkAccess.getEndpoint": {
36080
36428
  capName: "network-access",
36081
36429
  capScope: "system",
@@ -40171,6 +40519,56 @@ Object.freeze({
40171
40519
  form: "single",
40172
40520
  optional: false
40173
40521
  }],
40522
+ "navigation.getFeatures": [{
40523
+ name: "deviceId",
40524
+ form: "single",
40525
+ optional: false
40526
+ }],
40527
+ "navigation.goToPoint": [{
40528
+ name: "deviceId",
40529
+ form: "single",
40530
+ optional: false
40531
+ }],
40532
+ "navigation.listActions": [{
40533
+ name: "deviceId",
40534
+ form: "single",
40535
+ optional: false
40536
+ }],
40537
+ "navigation.move": [{
40538
+ name: "deviceId",
40539
+ form: "single",
40540
+ optional: false
40541
+ }],
40542
+ "navigation.playSound": [{
40543
+ name: "deviceId",
40544
+ form: "single",
40545
+ optional: false
40546
+ }],
40547
+ "navigation.runAction": [{
40548
+ name: "deviceId",
40549
+ form: "single",
40550
+ optional: false
40551
+ }],
40552
+ "navigation.setLightLevel": [{
40553
+ name: "deviceId",
40554
+ form: "single",
40555
+ optional: false
40556
+ }],
40557
+ "navigation.setLightMode": [{
40558
+ name: "deviceId",
40559
+ form: "single",
40560
+ optional: false
40561
+ }],
40562
+ "navigation.setLightOn": [{
40563
+ name: "deviceId",
40564
+ form: "single",
40565
+ optional: false
40566
+ }],
40567
+ "navigation.stop": [{
40568
+ name: "deviceId",
40569
+ form: "single",
40570
+ optional: false
40571
+ }],
40174
40572
  "networkQuality.getDeviceStats": [{
40175
40573
  name: "deviceId",
40176
40574
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5405,6 +5405,12 @@ Object.fromEntries([
5405
5405
  icon: "move",
5406
5406
  order: 40
5407
5407
  },
5408
+ {
5409
+ id: "navigation",
5410
+ label: "Navigation",
5411
+ icon: "compass",
5412
+ order: 41
5413
+ },
5408
5414
  {
5409
5415
  id: "consumables",
5410
5416
  label: "Consumables",
@@ -28946,6 +28952,287 @@ var ptzAutotrackCapability = {
28946
28952
  */
28947
28953
  durability: "session"
28948
28954
  };
28955
+ /**
28956
+ * `navigation` — a device-scoped capability that natively expresses the FULL
28957
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
28958
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
28959
+ *
28960
+ * Why a NEW cap rather than overloading `ptz`:
28961
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
28962
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
28963
+ * The two are different physical models: PTZ is absolute-position + presets,
28964
+ * navigation is momentary drive nudges + discrete robot ACTIONS
28965
+ * (dock / spot-clean / follow-pet / go-to-point / …).
28966
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
28967
+ * the reverse:
28968
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
28969
+ * / `getOptions`), and
28970
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
28971
+ * robot camera shows up in the existing PTZ control path without every
28972
+ * PTZ provider learning about robots. The mapping lives in the adapter,
28973
+ * not here (see the addon design note):
28974
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
28975
+ * ptz.stop() → navigation.stop()
28976
+ * ptz.goHome() → navigation.runAction('goHome')
28977
+ * ptz.getPresets() → navigation.listActions() (id→preset)
28978
+ * ptz.goToPreset(id) → navigation.runAction(id)
28979
+ *
28980
+ * ## Continuous drive
28981
+ *
28982
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
28983
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
28984
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
28985
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
28986
+ * coalesce them. The UI owns the cadence.
28987
+ *
28988
+ * ## The action dictionary
28989
+ *
28990
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
28991
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
28992
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
28993
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
28994
+ * vendor-specific list. `kind: 'action'` entries are triggered with
28995
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
28996
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
28997
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
28998
+ *
28999
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29000
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29001
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29002
+ * every device handle. A future nodedreame publish adds a typed
29003
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29004
+ * provider can then swap the raw calls for the typed methods with no change to
29005
+ * THIS contract.
29006
+ */
29007
+ /**
29008
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29009
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29010
+ * halts it.
29011
+ *
29012
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29013
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29014
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29015
+ * vector by it (drivers without proportional drive ignore it).
29016
+ *
29017
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29018
+ * axis alone; an all-undefined nudge is a no-op.
29019
+ */
29020
+ var NavigationMoveCommandSchema = object({
29021
+ pan: number().min(-1).max(1).optional(),
29022
+ tilt: number().min(-1).max(1).optional(),
29023
+ speed: number().min(0).max(1).optional()
29024
+ });
29025
+ /**
29026
+ * The enumerated discrete actions a navigation-capable robot can perform via
29027
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29028
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29029
+ * `playSound` (see the `sound` dictionary entries).
29030
+ */
29031
+ var NavigationActionIdSchema = _enum([
29032
+ "goHome",
29033
+ "locate",
29034
+ "spotClean",
29035
+ "findPet",
29036
+ "personFollow",
29037
+ "stop",
29038
+ "startClean",
29039
+ "pauseClean",
29040
+ "dockWash",
29041
+ "autoEmpty",
29042
+ "flashOn",
29043
+ "flashOff"
29044
+ ]);
29045
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29046
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29047
+ /**
29048
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29049
+ * native panel and the PTZ mimic render as a button.
29050
+ *
29051
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29052
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29053
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29054
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29055
+ * - `label` — operator-facing English label.
29056
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29057
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29058
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29059
+ * flips it from config, never by editing code.
29060
+ */
29061
+ var NavigationActionEntrySchema = object({
29062
+ id: string(),
29063
+ kind: NavigationEntryKindSchema,
29064
+ label: string(),
29065
+ icon: string(),
29066
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29067
+ soundId: number().int().optional(),
29068
+ /** Per-device feature flag — render this entry only when true. */
29069
+ enabled: boolean()
29070
+ });
29071
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29072
+ var NavigationPointSchema = object({
29073
+ x: number(),
29074
+ y: number()
29075
+ });
29076
+ /**
29077
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29078
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29079
+ * that are turned on for THIS device. Data-driven: the provider derives these
29080
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29081
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29082
+ * that are not dictionary entries.
29083
+ *
29084
+ * - `move` / `stop` — the momentary drive joystick.
29085
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29086
+ * map-coordinate plumbing is wired.
29087
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29088
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29089
+ * - `light` — the on/off fill-light toggle (works anytime).
29090
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29091
+ * camera-service control; needs an active stream).
29092
+ */
29093
+ var NavigationFeaturesSchema = object({
29094
+ move: boolean(),
29095
+ stop: boolean(),
29096
+ goToPoint: boolean(),
29097
+ runAction: boolean(),
29098
+ playSound: boolean(),
29099
+ light: boolean(),
29100
+ lightMode: boolean()
29101
+ });
29102
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29103
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29104
+ /**
29105
+ * Live navigation state so the UI can reflect what the robot is doing:
29106
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29107
+ * - `following` — person/pet follow is currently armed.
29108
+ * - `flash` — the on-camera fill light is on.
29109
+ * - `lightMode` — auto vs manual fill-light mode.
29110
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29111
+ * `lightMode === 'manual'`.
29112
+ */
29113
+ var NavigationStatusSchema = object({
29114
+ mode: _enum([
29115
+ "idle",
29116
+ "cleaning",
29117
+ "spot",
29118
+ "following",
29119
+ "goto",
29120
+ "returning",
29121
+ "paused",
29122
+ "unknown"
29123
+ ]),
29124
+ following: boolean(),
29125
+ flash: boolean(),
29126
+ lightMode: NavigationLightModeSchema,
29127
+ lightLevel: number().min(40).max(100),
29128
+ /** Ms epoch when the slice was last updated. */
29129
+ lastChangedAt: number()
29130
+ });
29131
+ /**
29132
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29133
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29134
+ * convention.
29135
+ */
29136
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29137
+ var navigationCapability = {
29138
+ name: "navigation",
29139
+ scope: "device",
29140
+ deviceNative: true,
29141
+ mode: "singleton",
29142
+ deviceTypes: [DeviceType.Camera],
29143
+ deviceConfig: { ui: {
29144
+ kind: "widget",
29145
+ widgetId: "host/navigation-panel",
29146
+ tab: "navigation",
29147
+ topTab: true,
29148
+ label: "Navigation",
29149
+ order: 0
29150
+ } },
29151
+ methods: {
29152
+ /**
29153
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29154
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29155
+ * path) works for any authenticated user, not admin-only. The UI sends
29156
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29157
+ * a single drive write WITHOUT debouncing.
29158
+ */
29159
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29160
+ /** Halt all motion immediately (zero drive vector). */
29161
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29162
+ /** Send the robot to a point on its live map. */
29163
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29164
+ /**
29165
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29166
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29167
+ */
29168
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29169
+ /**
29170
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29171
+ * unsupported action ids are rejected by the provider.
29172
+ */
29173
+ runAction: method(object({
29174
+ deviceId: number(),
29175
+ actionId: NavigationActionIdSchema
29176
+ }), _void(), { kind: "mutation" }),
29177
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29178
+ playSound: method(object({
29179
+ deviceId: number(),
29180
+ soundId: number().int()
29181
+ }), _void(), { kind: "mutation" }),
29182
+ /**
29183
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29184
+ * works anytime, no active stream required).
29185
+ */
29186
+ setLightOn: method(object({
29187
+ deviceId: number(),
29188
+ on: boolean()
29189
+ }), _void(), { kind: "mutation" }),
29190
+ /**
29191
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29192
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29193
+ * action that generally needs an active camera stream/monitor session — the
29194
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29195
+ */
29196
+ setLightMode: method(object({
29197
+ deviceId: number(),
29198
+ mode: NavigationLightModeSchema,
29199
+ level: number().min(40).max(100).optional()
29200
+ }), _void(), { kind: "mutation" }),
29201
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29202
+ setLightLevel: method(object({
29203
+ deviceId: number(),
29204
+ level: number().min(40).max(100)
29205
+ }), _void(), { kind: "mutation" }),
29206
+ /**
29207
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29208
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29209
+ * `listActions`).
29210
+ */
29211
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29212
+ },
29213
+ events: { onStatusChanged: { data: object({
29214
+ deviceId: number(),
29215
+ status: NavigationStatusSchema
29216
+ }) } },
29217
+ status: {
29218
+ schema: NavigationStatusSchema,
29219
+ kind: "push"
29220
+ },
29221
+ /**
29222
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29223
+ * for live mode / follow / flash changes.
29224
+ */
29225
+ runtimeState: NavigationRuntimeStateSchema,
29226
+ /**
29227
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29228
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29229
+ * that. The live handle re-publishes on connect.
29230
+ *
29231
+ * See `RuntimeStateDurability`. Enforced by
29232
+ * `scripts/check-runtime-state-durability.ts`.
29233
+ */
29234
+ durability: "session"
29235
+ };
28949
29236
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
28950
29237
  kind: "mutation",
28951
29238
  auth: "admin"
@@ -32221,6 +32508,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32221
32508
  motionTrigger: motionTriggerCapability,
32222
32509
  motionZones: motionZonesCapability,
32223
32510
  nativeObjectDetection: nativeObjectDetectionCapability,
32511
+ navigation: navigationCapability,
32224
32512
  networkLink: networkLinkCapability,
32225
32513
  notifier: notifierCapability,
32226
32514
  numericSensor: numericSensorCapability,
@@ -36075,6 +36363,66 @@ Object.freeze({
36075
36363
  addonId: null,
36076
36364
  access: "create"
36077
36365
  },
36366
+ "navigation.getFeatures": {
36367
+ capName: "navigation",
36368
+ capScope: "device",
36369
+ addonId: null,
36370
+ access: "view"
36371
+ },
36372
+ "navigation.goToPoint": {
36373
+ capName: "navigation",
36374
+ capScope: "device",
36375
+ addonId: null,
36376
+ access: "create"
36377
+ },
36378
+ "navigation.listActions": {
36379
+ capName: "navigation",
36380
+ capScope: "device",
36381
+ addonId: null,
36382
+ access: "view"
36383
+ },
36384
+ "navigation.move": {
36385
+ capName: "navigation",
36386
+ capScope: "device",
36387
+ addonId: null,
36388
+ access: "create"
36389
+ },
36390
+ "navigation.playSound": {
36391
+ capName: "navigation",
36392
+ capScope: "device",
36393
+ addonId: null,
36394
+ access: "create"
36395
+ },
36396
+ "navigation.runAction": {
36397
+ capName: "navigation",
36398
+ capScope: "device",
36399
+ addonId: null,
36400
+ access: "create"
36401
+ },
36402
+ "navigation.setLightLevel": {
36403
+ capName: "navigation",
36404
+ capScope: "device",
36405
+ addonId: null,
36406
+ access: "create"
36407
+ },
36408
+ "navigation.setLightMode": {
36409
+ capName: "navigation",
36410
+ capScope: "device",
36411
+ addonId: null,
36412
+ access: "create"
36413
+ },
36414
+ "navigation.setLightOn": {
36415
+ capName: "navigation",
36416
+ capScope: "device",
36417
+ addonId: null,
36418
+ access: "create"
36419
+ },
36420
+ "navigation.stop": {
36421
+ capName: "navigation",
36422
+ capScope: "device",
36423
+ addonId: null,
36424
+ access: "create"
36425
+ },
36078
36426
  "networkAccess.getEndpoint": {
36079
36427
  capName: "network-access",
36080
36428
  capScope: "system",
@@ -40170,6 +40518,56 @@ Object.freeze({
40170
40518
  form: "single",
40171
40519
  optional: false
40172
40520
  }],
40521
+ "navigation.getFeatures": [{
40522
+ name: "deviceId",
40523
+ form: "single",
40524
+ optional: false
40525
+ }],
40526
+ "navigation.goToPoint": [{
40527
+ name: "deviceId",
40528
+ form: "single",
40529
+ optional: false
40530
+ }],
40531
+ "navigation.listActions": [{
40532
+ name: "deviceId",
40533
+ form: "single",
40534
+ optional: false
40535
+ }],
40536
+ "navigation.move": [{
40537
+ name: "deviceId",
40538
+ form: "single",
40539
+ optional: false
40540
+ }],
40541
+ "navigation.playSound": [{
40542
+ name: "deviceId",
40543
+ form: "single",
40544
+ optional: false
40545
+ }],
40546
+ "navigation.runAction": [{
40547
+ name: "deviceId",
40548
+ form: "single",
40549
+ optional: false
40550
+ }],
40551
+ "navigation.setLightLevel": [{
40552
+ name: "deviceId",
40553
+ form: "single",
40554
+ optional: false
40555
+ }],
40556
+ "navigation.setLightMode": [{
40557
+ name: "deviceId",
40558
+ form: "single",
40559
+ optional: false
40560
+ }],
40561
+ "navigation.setLightOn": [{
40562
+ name: "deviceId",
40563
+ form: "single",
40564
+ optional: false
40565
+ }],
40566
+ "navigation.stop": [{
40567
+ name: "deviceId",
40568
+ form: "single",
40569
+ optional: false
40570
+ }],
40173
40571
  "networkQuality.getDeviceStats": [{
40174
40572
  name: "deviceId",
40175
40573
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-velux",
3
- "version": "0.2.70",
3
+ "version": "0.2.72",
4
4
  "description": "Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt)",
5
5
  "keywords": [
6
6
  "camstack",