@camstack/addon-provider-homeassistant 1.2.86 → 1.2.88

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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("./dist-lHF9qIyU.js");
2
+ const require_dist = require("./dist-BBVEH2jM.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_zlib = require("node:zlib");
5
5
  //#region src/ha-device-source.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-l3fKSOoz.mjs";
1
+ import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-CrOwnDRr.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
4
4
  //#region src/ha-device-source.ts
@@ -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",
@@ -29424,6 +29430,287 @@ var ptzAutotrackCapability = {
29424
29430
  */
29425
29431
  durability: "session"
29426
29432
  };
29433
+ /**
29434
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29435
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29436
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29437
+ *
29438
+ * Why a NEW cap rather than overloading `ptz`:
29439
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29440
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29441
+ * The two are different physical models: PTZ is absolute-position + presets,
29442
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29443
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29444
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29445
+ * the reverse:
29446
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29447
+ * / `getOptions`), and
29448
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29449
+ * robot camera shows up in the existing PTZ control path without every
29450
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29451
+ * not here (see the addon design note):
29452
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29453
+ * ptz.stop() → navigation.stop()
29454
+ * ptz.goHome() → navigation.runAction('goHome')
29455
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29456
+ * ptz.goToPreset(id) → navigation.runAction(id)
29457
+ *
29458
+ * ## Continuous drive
29459
+ *
29460
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29461
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29462
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29463
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29464
+ * coalesce them. The UI owns the cadence.
29465
+ *
29466
+ * ## The action dictionary
29467
+ *
29468
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29469
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29470
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29471
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29472
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29473
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29474
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29475
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29476
+ *
29477
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29478
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29479
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29480
+ * every device handle. A future nodedreame publish adds a typed
29481
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29482
+ * provider can then swap the raw calls for the typed methods with no change to
29483
+ * THIS contract.
29484
+ */
29485
+ /**
29486
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29487
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29488
+ * halts it.
29489
+ *
29490
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29491
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29492
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29493
+ * vector by it (drivers without proportional drive ignore it).
29494
+ *
29495
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29496
+ * axis alone; an all-undefined nudge is a no-op.
29497
+ */
29498
+ var NavigationMoveCommandSchema = object({
29499
+ pan: number().min(-1).max(1).optional(),
29500
+ tilt: number().min(-1).max(1).optional(),
29501
+ speed: number().min(0).max(1).optional()
29502
+ });
29503
+ /**
29504
+ * The enumerated discrete actions a navigation-capable robot can perform via
29505
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29506
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29507
+ * `playSound` (see the `sound` dictionary entries).
29508
+ */
29509
+ var NavigationActionIdSchema = _enum([
29510
+ "goHome",
29511
+ "locate",
29512
+ "spotClean",
29513
+ "findPet",
29514
+ "personFollow",
29515
+ "stop",
29516
+ "startClean",
29517
+ "pauseClean",
29518
+ "dockWash",
29519
+ "autoEmpty",
29520
+ "flashOn",
29521
+ "flashOff"
29522
+ ]);
29523
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29524
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29525
+ /**
29526
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29527
+ * native panel and the PTZ mimic render as a button.
29528
+ *
29529
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29530
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29531
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29532
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29533
+ * - `label` — operator-facing English label.
29534
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29535
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29536
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29537
+ * flips it from config, never by editing code.
29538
+ */
29539
+ var NavigationActionEntrySchema = object({
29540
+ id: string(),
29541
+ kind: NavigationEntryKindSchema,
29542
+ label: string(),
29543
+ icon: string(),
29544
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29545
+ soundId: number().int().optional(),
29546
+ /** Per-device feature flag — render this entry only when true. */
29547
+ enabled: boolean()
29548
+ });
29549
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29550
+ var NavigationPointSchema = object({
29551
+ x: number(),
29552
+ y: number()
29553
+ });
29554
+ /**
29555
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29556
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29557
+ * that are turned on for THIS device. Data-driven: the provider derives these
29558
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29559
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29560
+ * that are not dictionary entries.
29561
+ *
29562
+ * - `move` / `stop` — the momentary drive joystick.
29563
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29564
+ * map-coordinate plumbing is wired.
29565
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29566
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29567
+ * - `light` — the on/off fill-light toggle (works anytime).
29568
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29569
+ * camera-service control; needs an active stream).
29570
+ */
29571
+ var NavigationFeaturesSchema = object({
29572
+ move: boolean(),
29573
+ stop: boolean(),
29574
+ goToPoint: boolean(),
29575
+ runAction: boolean(),
29576
+ playSound: boolean(),
29577
+ light: boolean(),
29578
+ lightMode: boolean()
29579
+ });
29580
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29581
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29582
+ /**
29583
+ * Live navigation state so the UI can reflect what the robot is doing:
29584
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29585
+ * - `following` — person/pet follow is currently armed.
29586
+ * - `flash` — the on-camera fill light is on.
29587
+ * - `lightMode` — auto vs manual fill-light mode.
29588
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29589
+ * `lightMode === 'manual'`.
29590
+ */
29591
+ var NavigationStatusSchema = object({
29592
+ mode: _enum([
29593
+ "idle",
29594
+ "cleaning",
29595
+ "spot",
29596
+ "following",
29597
+ "goto",
29598
+ "returning",
29599
+ "paused",
29600
+ "unknown"
29601
+ ]),
29602
+ following: boolean(),
29603
+ flash: boolean(),
29604
+ lightMode: NavigationLightModeSchema,
29605
+ lightLevel: number().min(40).max(100),
29606
+ /** Ms epoch when the slice was last updated. */
29607
+ lastChangedAt: number()
29608
+ });
29609
+ /**
29610
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29611
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29612
+ * convention.
29613
+ */
29614
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29615
+ var navigationCapability = {
29616
+ name: "navigation",
29617
+ scope: "device",
29618
+ deviceNative: true,
29619
+ mode: "singleton",
29620
+ deviceTypes: [DeviceType.Camera],
29621
+ deviceConfig: { ui: {
29622
+ kind: "widget",
29623
+ widgetId: "host/navigation-panel",
29624
+ tab: "navigation",
29625
+ topTab: true,
29626
+ label: "Navigation",
29627
+ order: 0
29628
+ } },
29629
+ methods: {
29630
+ /**
29631
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29632
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29633
+ * path) works for any authenticated user, not admin-only. The UI sends
29634
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29635
+ * a single drive write WITHOUT debouncing.
29636
+ */
29637
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29638
+ /** Halt all motion immediately (zero drive vector). */
29639
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29640
+ /** Send the robot to a point on its live map. */
29641
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29642
+ /**
29643
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29644
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29645
+ */
29646
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29647
+ /**
29648
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29649
+ * unsupported action ids are rejected by the provider.
29650
+ */
29651
+ runAction: method(object({
29652
+ deviceId: number(),
29653
+ actionId: NavigationActionIdSchema
29654
+ }), _void(), { kind: "mutation" }),
29655
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29656
+ playSound: method(object({
29657
+ deviceId: number(),
29658
+ soundId: number().int()
29659
+ }), _void(), { kind: "mutation" }),
29660
+ /**
29661
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29662
+ * works anytime, no active stream required).
29663
+ */
29664
+ setLightOn: method(object({
29665
+ deviceId: number(),
29666
+ on: boolean()
29667
+ }), _void(), { kind: "mutation" }),
29668
+ /**
29669
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29670
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29671
+ * action that generally needs an active camera stream/monitor session — the
29672
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29673
+ */
29674
+ setLightMode: method(object({
29675
+ deviceId: number(),
29676
+ mode: NavigationLightModeSchema,
29677
+ level: number().min(40).max(100).optional()
29678
+ }), _void(), { kind: "mutation" }),
29679
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29680
+ setLightLevel: method(object({
29681
+ deviceId: number(),
29682
+ level: number().min(40).max(100)
29683
+ }), _void(), { kind: "mutation" }),
29684
+ /**
29685
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29686
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29687
+ * `listActions`).
29688
+ */
29689
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29690
+ },
29691
+ events: { onStatusChanged: { data: object({
29692
+ deviceId: number(),
29693
+ status: NavigationStatusSchema
29694
+ }) } },
29695
+ status: {
29696
+ schema: NavigationStatusSchema,
29697
+ kind: "push"
29698
+ },
29699
+ /**
29700
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29701
+ * for live mode / follow / flash changes.
29702
+ */
29703
+ runtimeState: NavigationRuntimeStateSchema,
29704
+ /**
29705
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29706
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29707
+ * that. The live handle re-publishes on connect.
29708
+ *
29709
+ * See `RuntimeStateDurability`. Enforced by
29710
+ * `scripts/check-runtime-state-durability.ts`.
29711
+ */
29712
+ durability: "session"
29713
+ };
29427
29714
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29428
29715
  kind: "mutation",
29429
29716
  auth: "admin"
@@ -32699,6 +32986,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32699
32986
  motionTrigger: motionTriggerCapability,
32700
32987
  motionZones: motionZonesCapability,
32701
32988
  nativeObjectDetection: nativeObjectDetectionCapability,
32989
+ navigation: navigationCapability,
32702
32990
  networkLink: networkLinkCapability,
32703
32991
  notifier: notifierCapability,
32704
32992
  numericSensor: numericSensorCapability,
@@ -36553,6 +36841,66 @@ Object.freeze({
36553
36841
  addonId: null,
36554
36842
  access: "create"
36555
36843
  },
36844
+ "navigation.getFeatures": {
36845
+ capName: "navigation",
36846
+ capScope: "device",
36847
+ addonId: null,
36848
+ access: "view"
36849
+ },
36850
+ "navigation.goToPoint": {
36851
+ capName: "navigation",
36852
+ capScope: "device",
36853
+ addonId: null,
36854
+ access: "create"
36855
+ },
36856
+ "navigation.listActions": {
36857
+ capName: "navigation",
36858
+ capScope: "device",
36859
+ addonId: null,
36860
+ access: "view"
36861
+ },
36862
+ "navigation.move": {
36863
+ capName: "navigation",
36864
+ capScope: "device",
36865
+ addonId: null,
36866
+ access: "create"
36867
+ },
36868
+ "navigation.playSound": {
36869
+ capName: "navigation",
36870
+ capScope: "device",
36871
+ addonId: null,
36872
+ access: "create"
36873
+ },
36874
+ "navigation.runAction": {
36875
+ capName: "navigation",
36876
+ capScope: "device",
36877
+ addonId: null,
36878
+ access: "create"
36879
+ },
36880
+ "navigation.setLightLevel": {
36881
+ capName: "navigation",
36882
+ capScope: "device",
36883
+ addonId: null,
36884
+ access: "create"
36885
+ },
36886
+ "navigation.setLightMode": {
36887
+ capName: "navigation",
36888
+ capScope: "device",
36889
+ addonId: null,
36890
+ access: "create"
36891
+ },
36892
+ "navigation.setLightOn": {
36893
+ capName: "navigation",
36894
+ capScope: "device",
36895
+ addonId: null,
36896
+ access: "create"
36897
+ },
36898
+ "navigation.stop": {
36899
+ capName: "navigation",
36900
+ capScope: "device",
36901
+ addonId: null,
36902
+ access: "create"
36903
+ },
36556
36904
  "networkAccess.getEndpoint": {
36557
36905
  capName: "network-access",
36558
36906
  capScope: "system",
@@ -40648,6 +40996,56 @@ Object.freeze({
40648
40996
  form: "single",
40649
40997
  optional: false
40650
40998
  }],
40999
+ "navigation.getFeatures": [{
41000
+ name: "deviceId",
41001
+ form: "single",
41002
+ optional: false
41003
+ }],
41004
+ "navigation.goToPoint": [{
41005
+ name: "deviceId",
41006
+ form: "single",
41007
+ optional: false
41008
+ }],
41009
+ "navigation.listActions": [{
41010
+ name: "deviceId",
41011
+ form: "single",
41012
+ optional: false
41013
+ }],
41014
+ "navigation.move": [{
41015
+ name: "deviceId",
41016
+ form: "single",
41017
+ optional: false
41018
+ }],
41019
+ "navigation.playSound": [{
41020
+ name: "deviceId",
41021
+ form: "single",
41022
+ optional: false
41023
+ }],
41024
+ "navigation.runAction": [{
41025
+ name: "deviceId",
41026
+ form: "single",
41027
+ optional: false
41028
+ }],
41029
+ "navigation.setLightLevel": [{
41030
+ name: "deviceId",
41031
+ form: "single",
41032
+ optional: false
41033
+ }],
41034
+ "navigation.setLightMode": [{
41035
+ name: "deviceId",
41036
+ form: "single",
41037
+ optional: false
41038
+ }],
41039
+ "navigation.setLightOn": [{
41040
+ name: "deviceId",
41041
+ form: "single",
41042
+ optional: false
41043
+ }],
41044
+ "navigation.stop": [{
41045
+ name: "deviceId",
41046
+ form: "single",
41047
+ optional: false
41048
+ }],
40651
41049
  "networkQuality.getDeviceStats": [{
40652
41050
  name: "deviceId",
40653
41051
  form: "single",
@@ -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",
@@ -29424,6 +29430,287 @@ var ptzAutotrackCapability = {
29424
29430
  */
29425
29431
  durability: "session"
29426
29432
  };
29433
+ /**
29434
+ * `navigation` — a device-scoped capability that natively expresses the FULL
29435
+ * navigation / action surface of a robot that DRIVES ITSELF and carries an
29436
+ * on-board camera (the Dreame robot-vacuum camera is the first provider).
29437
+ *
29438
+ * Why a NEW cap rather than overloading `ptz`:
29439
+ * - `ptz` moves a *gimbal* on a fixed camera (pan/tilt/zoom of the lens). A
29440
+ * robot vacuum has no gimbal — the whole chassis drives, turns and spins.
29441
+ * The two are different physical models: PTZ is absolute-position + presets,
29442
+ * navigation is momentary drive nudges + discrete robot ACTIONS
29443
+ * (dock / spot-clean / follow-pet / go-to-point / …).
29444
+ * - This cap is the SOURCE OF TRUTH. Two consumers adapt from it rather than
29445
+ * the reverse:
29446
+ * 1. a native CamStack navigation panel (data-driven from `listActions`
29447
+ * / `getOptions`), and
29448
+ * 2. the PTZ surface — a thin adapter mimics `ptz` from `navigation` so a
29449
+ * robot camera shows up in the existing PTZ control path without every
29450
+ * PTZ provider learning about robots. The mapping lives in the adapter,
29451
+ * not here (see the addon design note):
29452
+ * ptz.continuousMove({pan,tilt}) → navigation.move({pan,tilt})
29453
+ * ptz.stop() → navigation.stop()
29454
+ * ptz.goHome() → navigation.runAction('goHome')
29455
+ * ptz.getPresets() → navigation.listActions() (id→preset)
29456
+ * ptz.goToPreset(id) → navigation.runAction(id)
29457
+ *
29458
+ * ## Continuous drive
29459
+ *
29460
+ * `move` is MOMENTARY. Fluid navigation comes from the UI (or the PTZ adapter)
29461
+ * sending `move({pan,tilt})` REPEATEDLY at ~1 Hz while a direction is held, and
29462
+ * one `stop()` on release — exactly like the robot app's remote-drive joystick.
29463
+ * The provider forwards EACH `move` to one drive write; it must NOT debounce or
29464
+ * coalesce them. The UI owns the cadence.
29465
+ *
29466
+ * ## The action dictionary
29467
+ *
29468
+ * The discrete controls (dock / locate / spot-clean / follow / flash / sounds)
29469
+ * are a DATA-DRIVEN dictionary the cap exposes via `listActions()`. Each entry
29470
+ * carries `{ id, kind, label, icon }` (plus `soundId` for sound entries) so the
29471
+ * native panel AND the PTZ mimic render buttons WITHOUT hardcoding a
29472
+ * vendor-specific list. `kind: 'action'` entries are triggered with
29473
+ * `runAction({ actionId })`; `kind: 'sound'` entries with `playSound({ soundId })`
29474
+ * (the entry carries the `soundId` to pass). The general primitives — `move`,
29475
+ * `stop`, `goToPoint` — stay as first-class methods, not dictionary entries.
29476
+ *
29477
+ * NOTE (provider wiring): the first provider (Dreame) drives this with the RAW
29478
+ * `callAction(siid,aiid,in)` / `setProperty({siid,piid,value})` MIoT primitives
29479
+ * that the currently-published `@apocaliss92/nodedreame` already exposes on
29480
+ * every device handle. A future nodedreame publish adds a typed
29481
+ * `DreameCameraController` (drive / playPetSound / spotClean / findPet / …); the
29482
+ * provider can then swap the raw calls for the typed methods with no change to
29483
+ * THIS contract.
29484
+ */
29485
+ /**
29486
+ * A momentary drive nudge. The robot MOVES (no gimbal) for as long as the caller
29487
+ * keeps sending nudges (~1 Hz); an explicit `stop` (or letting the nudges lapse)
29488
+ * halts it.
29489
+ *
29490
+ * - `pan` — turn: negative = left, positive = right, 0 = straight.
29491
+ * - `tilt` — throttle: positive = forward, negative = spin / turn-around.
29492
+ * - `speed` — optional intensity hint [0, 1]; the provider may scale the drive
29493
+ * vector by it (drivers without proportional drive ignore it).
29494
+ *
29495
+ * `pan` / `tilt` are normalized [-1, 1]. Both optional so a caller can nudge one
29496
+ * axis alone; an all-undefined nudge is a no-op.
29497
+ */
29498
+ var NavigationMoveCommandSchema = object({
29499
+ pan: number().min(-1).max(1).optional(),
29500
+ tilt: number().min(-1).max(1).optional(),
29501
+ speed: number().min(0).max(1).optional()
29502
+ });
29503
+ /**
29504
+ * The enumerated discrete actions a navigation-capable robot can perform via
29505
+ * `runAction`. This is the CLOSED vocabulary; a given device advertises the
29506
+ * subset it supports through `listActions`. Sounds are NOT here — they go through
29507
+ * `playSound` (see the `sound` dictionary entries).
29508
+ */
29509
+ var NavigationActionIdSchema = _enum([
29510
+ "goHome",
29511
+ "locate",
29512
+ "spotClean",
29513
+ "findPet",
29514
+ "personFollow",
29515
+ "stop",
29516
+ "startClean",
29517
+ "pauseClean",
29518
+ "dockWash",
29519
+ "autoEmpty",
29520
+ "flashOn",
29521
+ "flashOff"
29522
+ ]);
29523
+ /** Whether a dictionary entry is a `runAction` action or a `playSound` sound. */
29524
+ var NavigationEntryKindSchema = _enum(["action", "sound"]);
29525
+ /**
29526
+ * One entry in the navigation action dictionary — the DATA-DRIVEN unit both the
29527
+ * native panel and the PTZ mimic render as a button.
29528
+ *
29529
+ * - `id` — stable id. For `kind:'action'` it is a {@link NavigationActionId}
29530
+ * (pass to `runAction`); for `kind:'sound'` it is a namespaced id
29531
+ * (`sound:meow`) whose `soundId` is passed to `playSound`.
29532
+ * - `icon` — icon HINT (lucide-style name; the UI maps it to its own set).
29533
+ * - `label` — operator-facing English label.
29534
+ * - `soundId` — wire sound id, present only on `kind:'sound'` entries.
29535
+ * - `enabled` — per-device FEATURE FLAG. `listActions` reports it so the UI /
29536
+ * PTZ render ONLY enabled entries. Data-driven: the provider
29537
+ * flips it from config, never by editing code.
29538
+ */
29539
+ var NavigationActionEntrySchema = object({
29540
+ id: string(),
29541
+ kind: NavigationEntryKindSchema,
29542
+ label: string(),
29543
+ icon: string(),
29544
+ /** Present only on `kind:'sound'` entries — the id to pass to `playSound`. */
29545
+ soundId: number().int().optional(),
29546
+ /** Per-device feature flag — render this entry only when true. */
29547
+ enabled: boolean()
29548
+ });
29549
+ /** Coordinates for `goToPoint` — a point on the robot's live map. */
29550
+ var NavigationPointSchema = object({
29551
+ x: number(),
29552
+ y: number()
29553
+ });
29554
+ /**
29555
+ * Per-device FEATURE-FLAG report for the general (non-dictionary) primitives.
29556
+ * The cap reports which are enabled so the UI / PTZ render only the controls
29557
+ * that are turned on for THIS device. Data-driven: the provider derives these
29558
+ * from config + probe, never hardcoded in the UI. The per-DICTIONARY-entry flags
29559
+ * live on {@link NavigationActionEntrySchema.enabled}; these gate the primitives
29560
+ * that are not dictionary entries.
29561
+ *
29562
+ * - `move` / `stop` — the momentary drive joystick.
29563
+ * - `goToPoint` — send-to-map-coordinate. Ships OFF on Dreame until the
29564
+ * map-coordinate plumbing is wired.
29565
+ * - `runAction` — the discrete action buttons (dictionary `kind:'action'`).
29566
+ * - `playSound` — the sound buttons (dictionary `kind:'sound'`).
29567
+ * - `light` — the on/off fill-light toggle (works anytime).
29568
+ * - `lightMode` — the auto/manual selector + manual level slider (a
29569
+ * camera-service control; needs an active stream).
29570
+ */
29571
+ var NavigationFeaturesSchema = object({
29572
+ move: boolean(),
29573
+ stop: boolean(),
29574
+ goToPoint: boolean(),
29575
+ runAction: boolean(),
29576
+ playSound: boolean(),
29577
+ light: boolean(),
29578
+ lightMode: boolean()
29579
+ });
29580
+ /** Light mode: `auto` lets the camera choose brightness; `manual` uses `level`. */
29581
+ var NavigationLightModeSchema = _enum(["auto", "manual"]);
29582
+ /**
29583
+ * Live navigation state so the UI can reflect what the robot is doing:
29584
+ * - `mode` — coarse activity (idle / cleaning / following / …).
29585
+ * - `following` — person/pet follow is currently armed.
29586
+ * - `flash` — the on-camera fill light is on.
29587
+ * - `lightMode` — auto vs manual fill-light mode.
29588
+ * - `lightLevel` — manual fill-light level (40..100); meaningful when
29589
+ * `lightMode === 'manual'`.
29590
+ */
29591
+ var NavigationStatusSchema = object({
29592
+ mode: _enum([
29593
+ "idle",
29594
+ "cleaning",
29595
+ "spot",
29596
+ "following",
29597
+ "goto",
29598
+ "returning",
29599
+ "paused",
29600
+ "unknown"
29601
+ ]),
29602
+ following: boolean(),
29603
+ flash: boolean(),
29604
+ lightMode: NavigationLightModeSchema,
29605
+ lightLevel: number().min(40).max(100),
29606
+ /** Ms epoch when the slice was last updated. */
29607
+ lastChangedAt: number()
29608
+ });
29609
+ /**
29610
+ * Runtime-state slice owned by this cap (kernel-managed: validated, mirrored,
29611
+ * observable). Adds `lastFetchedAt` on top of the status shape per the
29612
+ * convention.
29613
+ */
29614
+ var NavigationRuntimeStateSchema = NavigationStatusSchema.extend({ lastFetchedAt: number() });
29615
+ var navigationCapability = {
29616
+ name: "navigation",
29617
+ scope: "device",
29618
+ deviceNative: true,
29619
+ mode: "singleton",
29620
+ deviceTypes: [DeviceType.Camera],
29621
+ deviceConfig: { ui: {
29622
+ kind: "widget",
29623
+ widgetId: "host/navigation-panel",
29624
+ tab: "navigation",
29625
+ topTab: true,
29626
+ label: "Navigation",
29627
+ order: 0
29628
+ } },
29629
+ methods: {
29630
+ /**
29631
+ * Momentary drive nudge (the robot moves). `protected` — mirrors
29632
+ * `ptz.continuousMove` so the Viewer navigation panel (and the PTZ-mimic
29633
+ * path) works for any authenticated user, not admin-only. The UI sends
29634
+ * these at ~1 Hz while a control is held; the provider forwards each one to
29635
+ * a single drive write WITHOUT debouncing.
29636
+ */
29637
+ move: method(NavigationMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29638
+ /** Halt all motion immediately (zero drive vector). */
29639
+ stop: method(object({ deviceId: number() }), _void(), { kind: "mutation" }),
29640
+ /** Send the robot to a point on its live map. */
29641
+ goToPoint: method(NavigationPointSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }),
29642
+ /**
29643
+ * Enumerate the discrete controls THIS device supports (data-driven UI +
29644
+ * PTZ mimic). Camera-probed subset of {@link NAVIGATION_ACTION_CATALOG}.
29645
+ */
29646
+ listActions: method(object({ deviceId: number() }), array(NavigationActionEntrySchema)),
29647
+ /**
29648
+ * Run one discrete action (a `kind:'action'` dictionary entry). Invalid /
29649
+ * unsupported action ids are rejected by the provider.
29650
+ */
29651
+ runAction: method(object({
29652
+ deviceId: number(),
29653
+ actionId: NavigationActionIdSchema
29654
+ }), _void(), { kind: "mutation" }),
29655
+ /** Play a sound by its wire id (the `soundId` of a `kind:'sound'` entry). */
29656
+ playSound: method(object({
29657
+ deviceId: number(),
29658
+ soundId: number().int()
29659
+ }), _void(), { kind: "mutation" }),
29660
+ /**
29661
+ * Turn the on-camera fill light on / off (the `OpenFullLight` control —
29662
+ * works anytime, no active stream required).
29663
+ */
29664
+ setLightOn: method(object({
29665
+ deviceId: number(),
29666
+ on: boolean()
29667
+ }), _void(), { kind: "mutation" }),
29668
+ /**
29669
+ * Set the fill-light mode (auto vs manual). `manual` optionally carries the
29670
+ * initial `level`. The auto/manual + level control is a CAMERA-service
29671
+ * action that generally needs an active camera stream/monitor session — the
29672
+ * UI shows the manual level slider ONLY when `mode === 'manual'`.
29673
+ */
29674
+ setLightMode: method(object({
29675
+ deviceId: number(),
29676
+ mode: NavigationLightModeSchema,
29677
+ level: number().min(40).max(100).optional()
29678
+ }), _void(), { kind: "mutation" }),
29679
+ /** Set the MANUAL fill-light level (40..100). Implies `manual` mode. */
29680
+ setLightLevel: method(object({
29681
+ deviceId: number(),
29682
+ level: number().min(40).max(100)
29683
+ }), _void(), { kind: "mutation" }),
29684
+ /**
29685
+ * Per-device FEATURE-FLAG report for the general primitives — drives which
29686
+ * controls the UI shows (the per-entry flags for the dictionary come back on
29687
+ * `listActions`).
29688
+ */
29689
+ getFeatures: method(object({ deviceId: number() }), NavigationFeaturesSchema)
29690
+ },
29691
+ events: { onStatusChanged: { data: object({
29692
+ deviceId: number(),
29693
+ status: NavigationStatusSchema
29694
+ }) } },
29695
+ status: {
29696
+ schema: NavigationStatusSchema,
29697
+ kind: "push"
29698
+ },
29699
+ /**
29700
+ * Runtime-state slice mirrored by the kernel. The navigation panel watches it
29701
+ * for live mode / follow / flash changes.
29702
+ */
29703
+ runtimeState: NavigationRuntimeStateSchema,
29704
+ /**
29705
+ * Runtime-state durability: **session** — like `vacuum-control`, a restored
29706
+ * `mode: cleaning` / `following: true` is a robot that is not actually doing
29707
+ * that. The live handle re-publishes on connect.
29708
+ *
29709
+ * See `RuntimeStateDurability`. Enforced by
29710
+ * `scripts/check-runtime-state-durability.ts`.
29711
+ */
29712
+ durability: "session"
29713
+ };
29427
29714
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
29428
29715
  kind: "mutation",
29429
29716
  auth: "admin"
@@ -32699,6 +32986,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32699
32986
  motionTrigger: motionTriggerCapability,
32700
32987
  motionZones: motionZonesCapability,
32701
32988
  nativeObjectDetection: nativeObjectDetectionCapability,
32989
+ navigation: navigationCapability,
32702
32990
  networkLink: networkLinkCapability,
32703
32991
  notifier: notifierCapability,
32704
32992
  numericSensor: numericSensorCapability,
@@ -36553,6 +36841,66 @@ Object.freeze({
36553
36841
  addonId: null,
36554
36842
  access: "create"
36555
36843
  },
36844
+ "navigation.getFeatures": {
36845
+ capName: "navigation",
36846
+ capScope: "device",
36847
+ addonId: null,
36848
+ access: "view"
36849
+ },
36850
+ "navigation.goToPoint": {
36851
+ capName: "navigation",
36852
+ capScope: "device",
36853
+ addonId: null,
36854
+ access: "create"
36855
+ },
36856
+ "navigation.listActions": {
36857
+ capName: "navigation",
36858
+ capScope: "device",
36859
+ addonId: null,
36860
+ access: "view"
36861
+ },
36862
+ "navigation.move": {
36863
+ capName: "navigation",
36864
+ capScope: "device",
36865
+ addonId: null,
36866
+ access: "create"
36867
+ },
36868
+ "navigation.playSound": {
36869
+ capName: "navigation",
36870
+ capScope: "device",
36871
+ addonId: null,
36872
+ access: "create"
36873
+ },
36874
+ "navigation.runAction": {
36875
+ capName: "navigation",
36876
+ capScope: "device",
36877
+ addonId: null,
36878
+ access: "create"
36879
+ },
36880
+ "navigation.setLightLevel": {
36881
+ capName: "navigation",
36882
+ capScope: "device",
36883
+ addonId: null,
36884
+ access: "create"
36885
+ },
36886
+ "navigation.setLightMode": {
36887
+ capName: "navigation",
36888
+ capScope: "device",
36889
+ addonId: null,
36890
+ access: "create"
36891
+ },
36892
+ "navigation.setLightOn": {
36893
+ capName: "navigation",
36894
+ capScope: "device",
36895
+ addonId: null,
36896
+ access: "create"
36897
+ },
36898
+ "navigation.stop": {
36899
+ capName: "navigation",
36900
+ capScope: "device",
36901
+ addonId: null,
36902
+ access: "create"
36903
+ },
36556
36904
  "networkAccess.getEndpoint": {
36557
36905
  capName: "network-access",
36558
36906
  capScope: "system",
@@ -40648,6 +40996,56 @@ Object.freeze({
40648
40996
  form: "single",
40649
40997
  optional: false
40650
40998
  }],
40999
+ "navigation.getFeatures": [{
41000
+ name: "deviceId",
41001
+ form: "single",
41002
+ optional: false
41003
+ }],
41004
+ "navigation.goToPoint": [{
41005
+ name: "deviceId",
41006
+ form: "single",
41007
+ optional: false
41008
+ }],
41009
+ "navigation.listActions": [{
41010
+ name: "deviceId",
41011
+ form: "single",
41012
+ optional: false
41013
+ }],
41014
+ "navigation.move": [{
41015
+ name: "deviceId",
41016
+ form: "single",
41017
+ optional: false
41018
+ }],
41019
+ "navigation.playSound": [{
41020
+ name: "deviceId",
41021
+ form: "single",
41022
+ optional: false
41023
+ }],
41024
+ "navigation.runAction": [{
41025
+ name: "deviceId",
41026
+ form: "single",
41027
+ optional: false
41028
+ }],
41029
+ "navigation.setLightLevel": [{
41030
+ name: "deviceId",
41031
+ form: "single",
41032
+ optional: false
41033
+ }],
41034
+ "navigation.setLightMode": [{
41035
+ name: "deviceId",
41036
+ form: "single",
41037
+ optional: false
41038
+ }],
41039
+ "navigation.setLightOn": [{
41040
+ name: "deviceId",
41041
+ form: "single",
41042
+ optional: false
41043
+ }],
41044
+ "navigation.stop": [{
41045
+ name: "deviceId",
41046
+ form: "single",
41047
+ optional: false
41048
+ }],
40651
41049
  "networkQuality.getDeviceStats": [{
40652
41050
  name: "deviceId",
40653
41051
  form: "single",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  //#endregion
6
- const require_dist = require("../dist-lHF9qIyU.js");
6
+ const require_dist = require("../dist-BBVEH2jM.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  //#region src/ha-export/topics.ts
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-l3fKSOoz.mjs";
1
+ import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-CrOwnDRr.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  //#region src/ha-export/topics.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.86",
3
+ "version": "1.2.88",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",