@camstack/addon-provider-homeassistant 1.2.642 → 1.2.643

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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.643] - 2026-10-31
11
+
12
+ ### Changed
13
+
14
+ - The power-source capability is not exported to Home Assistant (manual admin recovery action).
15
+
10
16
  ## [1.2.642] - 2026-10-31
11
17
 
12
18
  ### Changed
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ha_broker_source = require("./ha-broker-source-B6xSmZ6H.js");
2
+ const require_ha_broker_source = require("./ha-broker-source-zbaephU5.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_zlib = require("node:zlib");
5
5
  //#region src/ha-admin-link.ts
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as humiditySensorCapability, $t as array, A as brokerCapability, At as temperatureSensorCapability, Bt as DeviceRole, C as alarmPanelCapability, Ct as runningFromVacuumState, D as bestLocationMatch, Dt as smokeCapability, E as batteryCapability, F as carbonMonoxideCapability, Ft as valveCapability, G as deviceAdoptionCapability, Gt as baseUnitOf, H as controlCapability, Ht as errMsg, I as climateControlCapability, It as vibrationCapability, J as eventEmitterCapability, Jt as defineRecordKinds, Kt as createEvent, L as colorCapability, Lt as waterHeaterCapability, M as buildDeviceAdminUrl, Mt as tryConvertUnit, N as buttonCapability, Nt as updateCapability, O as binaryCapability, Ot as switchCapability, P as calendarSourceCapability, Pt as vacuumControlCapability, Q as humidifierCapability, Qt as _enum, R as connectivityCapability, Rt as weatherCapability, S as airQualitySensorCapability, St as runningFromMediaPlayer, T as automationControlCapability, Tt as scriptRunnerCapability, U as coverCapability, V as contactCapability, Vt as DeviceType, W as deviceAdminLinkCapability, Wt as RecordSecretUnavailableError, X as floodCapability, Y as fanControlCapability, Yt as entryBody, Z as gasCapability, _t as publicEndpointReaderFrom, a as BaseDevice, an as record, at as motionCapability, b as accessoriesCapability, cn as unknown, ct as notifierCapability, dt as parseAdminBase, en as boolean, et as imageCapability, ft as powerMeterCapability, ht as pressureSensorCapability, in as object, it as mediaPlayerCapability, j as buildAddonRouteProvider, jt as tryConvertDelta, k as brightnessCapability, kt as tamperCapability, ln as url, lt as numericSensorCapability, mt as presenceCapability, nn as literal, nt as lawnMowerControlCapability, o as BaseDeviceProvider, on as string, ot as normalizeUnit, p as EnumSensorDateTimeFormatSchema, pt as prepareNotification, q as enumSensorCapability, qt as defineEntryKind, rn as number, rt as lockControlCapability, sn as union, st as notificationOutputCapability, t as HA_BROKER_KIND, tn as discriminatedUnion, tt as ingestReading, un as EventCategory, v as RUNNING_STATE_COLD, vt as quantityFromUnit, w as ambientLightSensorCapability, wt as runningStateCapability, x as addonRoutesCapability, xt as runningFromLawnMower, y as TargetSchema, yt as resolveAttachmentUrls, zt as DeviceFeature } from "./ha-broker-source-D9_yzN2c.mjs";
1
+ import { $ as humiditySensorCapability, $t as array, A as brokerCapability, At as temperatureSensorCapability, Bt as DeviceRole, C as alarmPanelCapability, Ct as runningFromVacuumState, D as bestLocationMatch, Dt as smokeCapability, E as batteryCapability, F as carbonMonoxideCapability, Ft as valveCapability, G as deviceAdoptionCapability, Gt as baseUnitOf, H as controlCapability, Ht as errMsg, I as climateControlCapability, It as vibrationCapability, J as eventEmitterCapability, Jt as defineRecordKinds, Kt as createEvent, L as colorCapability, Lt as waterHeaterCapability, M as buildDeviceAdminUrl, Mt as tryConvertUnit, N as buttonCapability, Nt as updateCapability, O as binaryCapability, Ot as switchCapability, P as calendarSourceCapability, Pt as vacuumControlCapability, Q as humidifierCapability, Qt as _enum, R as connectivityCapability, Rt as weatherCapability, S as airQualitySensorCapability, St as runningFromMediaPlayer, T as automationControlCapability, Tt as scriptRunnerCapability, U as coverCapability, V as contactCapability, Vt as DeviceType, W as deviceAdminLinkCapability, Wt as RecordSecretUnavailableError, X as floodCapability, Y as fanControlCapability, Yt as entryBody, Z as gasCapability, _t as publicEndpointReaderFrom, a as BaseDevice, an as record, at as motionCapability, b as accessoriesCapability, cn as unknown, ct as notifierCapability, dt as parseAdminBase, en as boolean, et as imageCapability, ft as powerMeterCapability, ht as pressureSensorCapability, in as object, it as mediaPlayerCapability, j as buildAddonRouteProvider, jt as tryConvertDelta, k as brightnessCapability, kt as tamperCapability, ln as url, lt as numericSensorCapability, mt as presenceCapability, nn as literal, nt as lawnMowerControlCapability, o as BaseDeviceProvider, on as string, ot as normalizeUnit, p as EnumSensorDateTimeFormatSchema, pt as prepareNotification, q as enumSensorCapability, qt as defineEntryKind, rn as number, rt as lockControlCapability, sn as union, st as notificationOutputCapability, t as HA_BROKER_KIND, tn as discriminatedUnion, tt as ingestReading, un as EventCategory, v as RUNNING_STATE_COLD, vt as quantityFromUnit, w as ambientLightSensorCapability, wt as runningStateCapability, x as addonRoutesCapability, xt as runningFromLawnMower, y as TargetSchema, yt as resolveAttachmentUrls, zt as DeviceFeature } from "./ha-broker-source-DxSvfCed.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
4
4
  //#region src/ha-admin-link.ts
@@ -5587,7 +5587,7 @@ var ZodIssueCode = {
5587
5587
  var ZodFirstPartyTypeKind;
5588
5588
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5589
5589
  //#endregion
5590
- //#region ../types/dist/sleep-SX9bkW3_.mjs
5590
+ //#region ../types/dist/sleep-dco0-jRo.mjs
5591
5591
  /**
5592
5592
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5593
5593
  * window to float samples (D455).
@@ -7290,6 +7290,26 @@ var BaseAddon = class {
7290
7290
  * alternative — skip it — turns a rename into a surface that quietly
7291
7291
  * empties, which looks exactly like an addon with nothing to configure.
7292
7292
  */
7293
+ /**
7294
+ * The form schema of ONE integration instance, or `null` to use {@link globalSettingsSchema}.
7295
+ *
7296
+ * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
7297
+ * needs its connection fields, the default integration the addon's own sections. It is the
7298
+ * SHAPE of the form only — the values live in `integrations.getSettings`, and the write path is
7299
+ * unchanged (`integrations.setSettings` for an account integration).
7300
+ */
7301
+ async integrationSettingsSchema(_instance) {
7302
+ return null;
7303
+ }
7304
+ /**
7305
+ * What the create wizard and the integration edit page render for one instance: the addon's
7306
+ * per-instance schema when it declares one, else its global schema (what they always showed).
7307
+ */
7308
+ async getIntegrationFormSchema(instance, nodeId) {
7309
+ const scoped = await this.integrationSettingsSchema(instance);
7310
+ if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
7311
+ return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
7312
+ }
7293
7313
  async getIntegrationSettings(nodeId) {
7294
7314
  const declared = this.integrationSettingSections();
7295
7315
  if (declared.length === 0) return null;
@@ -9263,6 +9283,7 @@ var CAP_NAMES = Object.freeze([
9263
9283
  "plate-gallery",
9264
9284
  "platform-probe",
9265
9285
  "power-meter",
9286
+ "power-source",
9266
9287
  "presence",
9267
9288
  "pressure-sensor",
9268
9289
  "privacy-mask",
@@ -10614,6 +10635,13 @@ Object.freeze({
10614
10635
  "valueType": "number"
10615
10636
  }
10616
10637
  ],
10638
+ "power-source": [{
10639
+ "path": "switchOn",
10640
+ "valueType": "boolean"
10641
+ }, {
10642
+ "path": "offSeconds",
10643
+ "valueType": "number"
10644
+ }],
10617
10645
  "presence": [
10618
10646
  {
10619
10647
  "path": "state",
@@ -12716,6 +12744,25 @@ var EventOwnerTypeSchema = _enum(EVENT_OWNER_TYPES);
12716
12744
  var MediaPresenceOwnerKindSchema = _enum([...EVENT_OWNER_TYPES, "track"]);
12717
12745
  new Set(EVENT_OWNER_TYPES);
12718
12746
  /**
12747
+ * Which integration instance a settings form is for. An addon that serves several instances
12748
+ * (`instanceMode: multiple`) can show a different form per instance — an NVR integration
12749
+ * needs its connection, the default integration needs the addon's own sections.
12750
+ *
12751
+ * - `integrationId` is `null` in the create wizard: nothing exists yet, the operator is
12752
+ * setting up a NEW instance.
12753
+ * - `mode` is the wizard mode of the integration type (`getAvailableTypes`).
12754
+ * - `candidateStableId` is the discovery candidate a wizard was seeded from, if any.
12755
+ */
12756
+ var IntegrationInstanceRefSchema = object({
12757
+ integrationId: string().nullable(),
12758
+ mode: _enum([
12759
+ "standalone",
12760
+ "account",
12761
+ "broker"
12762
+ ]),
12763
+ candidateStableId: string().optional()
12764
+ });
12765
+ /**
12719
12766
  * Build an `IAddonRouteProvider` from a list of routes. Implements
12720
12767
  * both the operator-facing `getRoutes` (returning route descriptors
12721
12768
  * minus the handlers, which can't cross JSON) and the framework-
@@ -16717,6 +16764,41 @@ var ACTUATOR_CAP_VOCABULARY = {
16717
16764
  icon: "droplets"
16718
16765
  }]
16719
16766
  },
16767
+ "power-source": {
16768
+ scope: "device",
16769
+ noun: t("Power source", "Alimentazione"),
16770
+ actions: [
16771
+ {
16772
+ id: "powerSource.on",
16773
+ method: "powerOn",
16774
+ label: t("Power on", "Dai corrente"),
16775
+ phrase: t("Power on {device}", "Dai corrente a {device}"),
16776
+ icon: "power"
16777
+ },
16778
+ {
16779
+ id: "powerSource.off",
16780
+ method: "powerOff",
16781
+ label: t("Power off", "Togli corrente"),
16782
+ phrase: t("Cut the power of {device}", "Togli la corrente a {device}"),
16783
+ icon: "power-off"
16784
+ },
16785
+ {
16786
+ id: "powerSource.forceRestart",
16787
+ method: "forceRestart",
16788
+ label: t("Force restart", "Riavvio forzato"),
16789
+ phrase: t("Force restart {device} by cutting its power", "Riavvia {device} togliendo la corrente"),
16790
+ icon: "refresh-cw"
16791
+ }
16792
+ ],
16793
+ state: [{
16794
+ kind: "boolean",
16795
+ field: "switchOn",
16796
+ label: t("Power switch on", "Presa accesa"),
16797
+ whenTrue: t("When the power of {device} comes on", "Quando arriva la corrente a {device}"),
16798
+ whenFalse: t("When the power of {device} is cut", "Quando manca la corrente a {device}"),
16799
+ icon: "power"
16800
+ }]
16801
+ },
16720
16802
  "lock-control": {
16721
16803
  scope: "device",
16722
16804
  noun: t("Lock", "Serratura"),
@@ -17192,7 +17274,7 @@ var ACTUATOR_CAP_VOCABULARY = {
17192
17274
  method: "setDirection",
17193
17275
  label: t("Spin forward", "Rotazione avanti"),
17194
17276
  phrase: t("Spin {device} forward", "Fai girare {device} in avanti"),
17195
- icon: "rotate-cw",
17277
+ icon: "refresh-cw",
17196
17278
  effect: {
17197
17279
  field: "direction",
17198
17280
  value: "forward"
@@ -43011,6 +43093,10 @@ method(object({
43011
43093
  }), method(object({
43012
43094
  addonId: string(),
43013
43095
  nodeId: string().optional()
43096
+ }), SettingsSchemaWithValuesSchema.nullable()), method(object({
43097
+ addonId: string(),
43098
+ nodeId: string().optional(),
43099
+ instance: IntegrationInstanceRefSchema
43014
43100
  }), SettingsSchemaWithValuesSchema.nullable()), method(object({
43015
43101
  addonId: string(),
43016
43102
  nodeId: string().optional()
@@ -45827,7 +45913,7 @@ method(object({
45827
45913
  kind: "mutation",
45828
45914
  auth: "admin"
45829
45915
  }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
45830
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
45916
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
45831
45917
  var NUMBER = {
45832
45918
  kind: "fixed",
45833
45919
  result: ["number"]
@@ -65853,19 +65939,19 @@ var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status:
65853
65939
  reason: _enum(["unknown-template", "not-a-media-player"]),
65854
65940
  detail: string()
65855
65941
  })]);
65856
- var deviceInput = object({ deviceId: number().int().nonnegative() });
65942
+ var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
65857
65943
  DeviceType.MediaPlayer;
65858
- method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
65944
+ method(deviceInput$1, RemoteConfigSchema, { auth: "admin" }), method(deviceInput$1.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
65859
65945
  kind: "mutation",
65860
65946
  auth: "admin"
65861
- }), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
65947
+ }), method(deviceInput$1, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput$1.extend({
65862
65948
  role: RemoteRoleSchema,
65863
65949
  /** Sends in a row (volume steps). */
65864
65950
  repeat: number().int().min(1).max(50).default(1)
65865
65951
  }), RemoteSendResultSchema, {
65866
65952
  kind: "mutation",
65867
65953
  auth: "protected"
65868
- }), method(deviceInput.extend({
65954
+ }), method(deviceInput$1.extend({
65869
65955
  command: RemoteMediaCommandSchema,
65870
65956
  muted: boolean().optional(),
65871
65957
  source: string().optional(),
@@ -70228,6 +70314,109 @@ var lockControlCapability = {
70228
70314
  * whether persisting is worth a SQLite commit. */
70229
70315
  volatileStateFields: ["lastChangedAt"]
70230
70316
  };
70317
+ var PowerSourceRefusalReasonSchema = _enum([
70318
+ "no-power-source",
70319
+ "switch-missing",
70320
+ "switch-offline",
70321
+ "switch-unknown",
70322
+ "restart-in-progress",
70323
+ "switch-call-failed"
70324
+ ]);
70325
+ var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
70326
+ accepted: literal(false),
70327
+ reason: PowerSourceRefusalReasonSchema,
70328
+ /** One line for the operator, naming the switch. */
70329
+ message: string()
70330
+ })]);
70331
+ var PowerSourceInfoSchema = object({
70332
+ /** False when the device has no power source linked; the rest is then empty. */
70333
+ linked: boolean(),
70334
+ switchDeviceId: number().nullable(),
70335
+ switchName: string().nullable(),
70336
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
70337
+ switchOn: boolean().nullable(),
70338
+ switchOnline: boolean().nullable(),
70339
+ restartInProgress: boolean(),
70340
+ offSeconds: number().int()
70341
+ });
70342
+ /** The composed slice: the switch state the link mirrors, plus the stored off time. */
70343
+ var PowerSourceStateSchema = object({
70344
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
70345
+ switchOn: boolean().nullable(),
70346
+ offSeconds: number().int(),
70347
+ lastFetchedAt: number()
70348
+ });
70349
+ var POWER_SOURCE_DEVICE_TYPES = [
70350
+ DeviceType.Gateway,
70351
+ DeviceType.Hub,
70352
+ DeviceType.Camera,
70353
+ DeviceType.Sensor,
70354
+ DeviceType.MediaPlayer,
70355
+ DeviceType.Vacuum,
70356
+ DeviceType.Generic
70357
+ ];
70358
+ var powerSourceCustomize = {
70359
+ version: 1,
70360
+ targets: [{
70361
+ id: "switch",
70362
+ cardinality: "scalar",
70363
+ vocabulary: {
70364
+ cap: "power-source",
70365
+ stateField: "switchOn"
70366
+ },
70367
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
70368
+ apply: "add",
70369
+ path: "switchOn",
70370
+ sources: [{
70371
+ kind: "switch",
70372
+ transforms: [{ kind: "identity" }]
70373
+ }],
70374
+ companions: [{
70375
+ kind: "constant",
70376
+ path: "offSeconds",
70377
+ value: 10,
70378
+ when: "add"
70379
+ }, {
70380
+ kind: "clock",
70381
+ path: "lastFetchedAt",
70382
+ when: "always"
70383
+ }],
70384
+ sourceReport: { status: "assignment-status" }
70385
+ }]
70386
+ };
70387
+ var deviceInput = object({ deviceId: number().int().nonnegative() });
70388
+ var powerSourceCapability = {
70389
+ name: "power-source",
70390
+ scope: "device",
70391
+ mode: "singleton",
70392
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
70393
+ methods: {
70394
+ getStatus: systemMethod(deviceInput, PowerSourceInfoSchema, { auth: "admin" }),
70395
+ powerOn: systemMethod(deviceInput, PowerSourceActionResultSchema, {
70396
+ kind: "mutation",
70397
+ auth: "admin"
70398
+ }),
70399
+ powerOff: systemMethod(deviceInput, PowerSourceActionResultSchema, {
70400
+ kind: "mutation",
70401
+ auth: "admin"
70402
+ }),
70403
+ forceRestart: systemMethod(deviceInput, PowerSourceActionResultSchema, {
70404
+ kind: "mutation",
70405
+ auth: "admin"
70406
+ })
70407
+ },
70408
+ runtimeState: PowerSourceStateSchema,
70409
+ customize: powerSourceCustomize,
70410
+ /**
70411
+ * Runtime-state durability: **session** — mirrored from the linked switch on
70412
+ * its next report; a restored value would outlive the reading it names.
70413
+ *
70414
+ * See `RuntimeStateDurability`. Enforced by
70415
+ * `scripts/check-runtime-state-durability.ts`.
70416
+ */
70417
+ durability: "session",
70418
+ history: "none"
70419
+ };
70231
70420
  /**
70232
70421
  * A monotonic total between resets (D944). Energy uses `power-meter.energy`
70233
70422
  * so dashboards keep one series; every other instantaneous reading lands here.
@@ -79013,6 +79202,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
79013
79202
  petFeeder: petFeederCapability,
79014
79203
  petFountain: petFountainCapability,
79015
79204
  powerMeter: powerMeterCapability,
79205
+ powerSource: powerSourceCapability,
79016
79206
  presence: presenceCapability,
79017
79207
  pressureSensor: pressureSensorCapability,
79018
79208
  privacyMask: privacyMaskCapability,
@@ -80682,6 +80872,13 @@ Object.freeze({
80682
80872
  access: "view",
80683
80873
  role: "admin"
80684
80874
  },
80875
+ "addonSettings.getIntegrationFormSchema": {
80876
+ capName: "addon-settings",
80877
+ capScope: "system",
80878
+ addonId: null,
80879
+ access: "view",
80880
+ role: "admin"
80881
+ },
80685
80882
  "addonSettings.getIntegrationSettings": {
80686
80883
  capName: "addon-settings",
80687
80884
  capScope: "system",
@@ -87402,6 +87599,34 @@ Object.freeze({
87402
87599
  access: "view",
87403
87600
  role: "viewer"
87404
87601
  },
87602
+ "powerSource.forceRestart": {
87603
+ capName: "power-source",
87604
+ capScope: "device",
87605
+ addonId: null,
87606
+ access: "create",
87607
+ role: "admin"
87608
+ },
87609
+ "powerSource.getStatus": {
87610
+ capName: "power-source",
87611
+ capScope: "device",
87612
+ addonId: null,
87613
+ access: "view",
87614
+ role: "admin"
87615
+ },
87616
+ "powerSource.powerOff": {
87617
+ capName: "power-source",
87618
+ capScope: "device",
87619
+ addonId: null,
87620
+ access: "create",
87621
+ role: "admin"
87622
+ },
87623
+ "powerSource.powerOn": {
87624
+ capName: "power-source",
87625
+ capScope: "device",
87626
+ addonId: null,
87627
+ access: "create",
87628
+ role: "admin"
87629
+ },
87405
87630
  "presence.getStatus": {
87406
87631
  capName: "presence",
87407
87632
  capScope: "device",
@@ -92561,6 +92786,26 @@ Object.freeze({
92561
92786
  form: "single",
92562
92787
  optional: false
92563
92788
  }],
92789
+ "powerSource.forceRestart": [{
92790
+ name: "deviceId",
92791
+ form: "single",
92792
+ optional: false
92793
+ }],
92794
+ "powerSource.getStatus": [{
92795
+ name: "deviceId",
92796
+ form: "single",
92797
+ optional: false
92798
+ }],
92799
+ "powerSource.powerOff": [{
92800
+ name: "deviceId",
92801
+ form: "single",
92802
+ optional: false
92803
+ }],
92804
+ "powerSource.powerOn": [{
92805
+ name: "deviceId",
92806
+ form: "single",
92807
+ optional: false
92808
+ }],
92564
92809
  "presence.getStatus": [{
92565
92810
  name: "deviceId",
92566
92811
  form: "single",
@@ -5588,7 +5588,7 @@ var ZodIssueCode = {
5588
5588
  var ZodFirstPartyTypeKind;
5589
5589
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5590
5590
  //#endregion
5591
- //#region ../types/dist/sleep-SX9bkW3_.mjs
5591
+ //#region ../types/dist/sleep-dco0-jRo.mjs
5592
5592
  /**
5593
5593
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5594
5594
  * window to float samples (D455).
@@ -7291,6 +7291,26 @@ var BaseAddon = class {
7291
7291
  * alternative — skip it — turns a rename into a surface that quietly
7292
7292
  * empties, which looks exactly like an addon with nothing to configure.
7293
7293
  */
7294
+ /**
7295
+ * The form schema of ONE integration instance, or `null` to use {@link globalSettingsSchema}.
7296
+ *
7297
+ * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
7298
+ * needs its connection fields, the default integration the addon's own sections. It is the
7299
+ * SHAPE of the form only — the values live in `integrations.getSettings`, and the write path is
7300
+ * unchanged (`integrations.setSettings` for an account integration).
7301
+ */
7302
+ async integrationSettingsSchema(_instance) {
7303
+ return null;
7304
+ }
7305
+ /**
7306
+ * What the create wizard and the integration edit page render for one instance: the addon's
7307
+ * per-instance schema when it declares one, else its global schema (what they always showed).
7308
+ */
7309
+ async getIntegrationFormSchema(instance, nodeId) {
7310
+ const scoped = await this.integrationSettingsSchema(instance);
7311
+ if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
7312
+ return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
7313
+ }
7294
7314
  async getIntegrationSettings(nodeId) {
7295
7315
  const declared = this.integrationSettingSections();
7296
7316
  if (declared.length === 0) return null;
@@ -9264,6 +9284,7 @@ var CAP_NAMES = Object.freeze([
9264
9284
  "plate-gallery",
9265
9285
  "platform-probe",
9266
9286
  "power-meter",
9287
+ "power-source",
9267
9288
  "presence",
9268
9289
  "pressure-sensor",
9269
9290
  "privacy-mask",
@@ -10615,6 +10636,13 @@ Object.freeze({
10615
10636
  "valueType": "number"
10616
10637
  }
10617
10638
  ],
10639
+ "power-source": [{
10640
+ "path": "switchOn",
10641
+ "valueType": "boolean"
10642
+ }, {
10643
+ "path": "offSeconds",
10644
+ "valueType": "number"
10645
+ }],
10618
10646
  "presence": [
10619
10647
  {
10620
10648
  "path": "state",
@@ -12717,6 +12745,25 @@ var EventOwnerTypeSchema = _enum(EVENT_OWNER_TYPES);
12717
12745
  var MediaPresenceOwnerKindSchema = _enum([...EVENT_OWNER_TYPES, "track"]);
12718
12746
  new Set(EVENT_OWNER_TYPES);
12719
12747
  /**
12748
+ * Which integration instance a settings form is for. An addon that serves several instances
12749
+ * (`instanceMode: multiple`) can show a different form per instance — an NVR integration
12750
+ * needs its connection, the default integration needs the addon's own sections.
12751
+ *
12752
+ * - `integrationId` is `null` in the create wizard: nothing exists yet, the operator is
12753
+ * setting up a NEW instance.
12754
+ * - `mode` is the wizard mode of the integration type (`getAvailableTypes`).
12755
+ * - `candidateStableId` is the discovery candidate a wizard was seeded from, if any.
12756
+ */
12757
+ var IntegrationInstanceRefSchema = object({
12758
+ integrationId: string().nullable(),
12759
+ mode: _enum([
12760
+ "standalone",
12761
+ "account",
12762
+ "broker"
12763
+ ]),
12764
+ candidateStableId: string().optional()
12765
+ });
12766
+ /**
12720
12767
  * Build an `IAddonRouteProvider` from a list of routes. Implements
12721
12768
  * both the operator-facing `getRoutes` (returning route descriptors
12722
12769
  * minus the handlers, which can't cross JSON) and the framework-
@@ -16718,6 +16765,41 @@ var ACTUATOR_CAP_VOCABULARY = {
16718
16765
  icon: "droplets"
16719
16766
  }]
16720
16767
  },
16768
+ "power-source": {
16769
+ scope: "device",
16770
+ noun: t("Power source", "Alimentazione"),
16771
+ actions: [
16772
+ {
16773
+ id: "powerSource.on",
16774
+ method: "powerOn",
16775
+ label: t("Power on", "Dai corrente"),
16776
+ phrase: t("Power on {device}", "Dai corrente a {device}"),
16777
+ icon: "power"
16778
+ },
16779
+ {
16780
+ id: "powerSource.off",
16781
+ method: "powerOff",
16782
+ label: t("Power off", "Togli corrente"),
16783
+ phrase: t("Cut the power of {device}", "Togli la corrente a {device}"),
16784
+ icon: "power-off"
16785
+ },
16786
+ {
16787
+ id: "powerSource.forceRestart",
16788
+ method: "forceRestart",
16789
+ label: t("Force restart", "Riavvio forzato"),
16790
+ phrase: t("Force restart {device} by cutting its power", "Riavvia {device} togliendo la corrente"),
16791
+ icon: "refresh-cw"
16792
+ }
16793
+ ],
16794
+ state: [{
16795
+ kind: "boolean",
16796
+ field: "switchOn",
16797
+ label: t("Power switch on", "Presa accesa"),
16798
+ whenTrue: t("When the power of {device} comes on", "Quando arriva la corrente a {device}"),
16799
+ whenFalse: t("When the power of {device} is cut", "Quando manca la corrente a {device}"),
16800
+ icon: "power"
16801
+ }]
16802
+ },
16721
16803
  "lock-control": {
16722
16804
  scope: "device",
16723
16805
  noun: t("Lock", "Serratura"),
@@ -17193,7 +17275,7 @@ var ACTUATOR_CAP_VOCABULARY = {
17193
17275
  method: "setDirection",
17194
17276
  label: t("Spin forward", "Rotazione avanti"),
17195
17277
  phrase: t("Spin {device} forward", "Fai girare {device} in avanti"),
17196
- icon: "rotate-cw",
17278
+ icon: "refresh-cw",
17197
17279
  effect: {
17198
17280
  field: "direction",
17199
17281
  value: "forward"
@@ -43012,6 +43094,10 @@ method(object({
43012
43094
  }), method(object({
43013
43095
  addonId: string(),
43014
43096
  nodeId: string().optional()
43097
+ }), SettingsSchemaWithValuesSchema.nullable()), method(object({
43098
+ addonId: string(),
43099
+ nodeId: string().optional(),
43100
+ instance: IntegrationInstanceRefSchema
43015
43101
  }), SettingsSchemaWithValuesSchema.nullable()), method(object({
43016
43102
  addonId: string(),
43017
43103
  nodeId: string().optional()
@@ -45828,7 +45914,7 @@ method(object({
45828
45914
  kind: "mutation",
45829
45915
  auth: "admin"
45830
45916
  }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
45831
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
45917
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
45832
45918
  var NUMBER = {
45833
45919
  kind: "fixed",
45834
45920
  result: ["number"]
@@ -65854,19 +65940,19 @@ var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status:
65854
65940
  reason: _enum(["unknown-template", "not-a-media-player"]),
65855
65941
  detail: string()
65856
65942
  })]);
65857
- var deviceInput = object({ deviceId: number().int().nonnegative() });
65943
+ var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
65858
65944
  DeviceType.MediaPlayer;
65859
- method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
65945
+ method(deviceInput$1, RemoteConfigSchema, { auth: "admin" }), method(deviceInput$1.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
65860
65946
  kind: "mutation",
65861
65947
  auth: "admin"
65862
- }), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
65948
+ }), method(deviceInput$1, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput$1.extend({
65863
65949
  role: RemoteRoleSchema,
65864
65950
  /** Sends in a row (volume steps). */
65865
65951
  repeat: number().int().min(1).max(50).default(1)
65866
65952
  }), RemoteSendResultSchema, {
65867
65953
  kind: "mutation",
65868
65954
  auth: "protected"
65869
- }), method(deviceInput.extend({
65955
+ }), method(deviceInput$1.extend({
65870
65956
  command: RemoteMediaCommandSchema,
65871
65957
  muted: boolean().optional(),
65872
65958
  source: string().optional(),
@@ -70229,6 +70315,109 @@ var lockControlCapability = {
70229
70315
  * whether persisting is worth a SQLite commit. */
70230
70316
  volatileStateFields: ["lastChangedAt"]
70231
70317
  };
70318
+ var PowerSourceRefusalReasonSchema = _enum([
70319
+ "no-power-source",
70320
+ "switch-missing",
70321
+ "switch-offline",
70322
+ "switch-unknown",
70323
+ "restart-in-progress",
70324
+ "switch-call-failed"
70325
+ ]);
70326
+ var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
70327
+ accepted: literal(false),
70328
+ reason: PowerSourceRefusalReasonSchema,
70329
+ /** One line for the operator, naming the switch. */
70330
+ message: string()
70331
+ })]);
70332
+ var PowerSourceInfoSchema = object({
70333
+ /** False when the device has no power source linked; the rest is then empty. */
70334
+ linked: boolean(),
70335
+ switchDeviceId: number().nullable(),
70336
+ switchName: string().nullable(),
70337
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
70338
+ switchOn: boolean().nullable(),
70339
+ switchOnline: boolean().nullable(),
70340
+ restartInProgress: boolean(),
70341
+ offSeconds: number().int()
70342
+ });
70343
+ /** The composed slice: the switch state the link mirrors, plus the stored off time. */
70344
+ var PowerSourceStateSchema = object({
70345
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
70346
+ switchOn: boolean().nullable(),
70347
+ offSeconds: number().int(),
70348
+ lastFetchedAt: number()
70349
+ });
70350
+ var POWER_SOURCE_DEVICE_TYPES = [
70351
+ DeviceType.Gateway,
70352
+ DeviceType.Hub,
70353
+ DeviceType.Camera,
70354
+ DeviceType.Sensor,
70355
+ DeviceType.MediaPlayer,
70356
+ DeviceType.Vacuum,
70357
+ DeviceType.Generic
70358
+ ];
70359
+ var powerSourceCustomize = {
70360
+ version: 1,
70361
+ targets: [{
70362
+ id: "switch",
70363
+ cardinality: "scalar",
70364
+ vocabulary: {
70365
+ cap: "power-source",
70366
+ stateField: "switchOn"
70367
+ },
70368
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
70369
+ apply: "add",
70370
+ path: "switchOn",
70371
+ sources: [{
70372
+ kind: "switch",
70373
+ transforms: [{ kind: "identity" }]
70374
+ }],
70375
+ companions: [{
70376
+ kind: "constant",
70377
+ path: "offSeconds",
70378
+ value: 10,
70379
+ when: "add"
70380
+ }, {
70381
+ kind: "clock",
70382
+ path: "lastFetchedAt",
70383
+ when: "always"
70384
+ }],
70385
+ sourceReport: { status: "assignment-status" }
70386
+ }]
70387
+ };
70388
+ var deviceInput = object({ deviceId: number().int().nonnegative() });
70389
+ var powerSourceCapability = {
70390
+ name: "power-source",
70391
+ scope: "device",
70392
+ mode: "singleton",
70393
+ deviceTypes: POWER_SOURCE_DEVICE_TYPES,
70394
+ methods: {
70395
+ getStatus: systemMethod(deviceInput, PowerSourceInfoSchema, { auth: "admin" }),
70396
+ powerOn: systemMethod(deviceInput, PowerSourceActionResultSchema, {
70397
+ kind: "mutation",
70398
+ auth: "admin"
70399
+ }),
70400
+ powerOff: systemMethod(deviceInput, PowerSourceActionResultSchema, {
70401
+ kind: "mutation",
70402
+ auth: "admin"
70403
+ }),
70404
+ forceRestart: systemMethod(deviceInput, PowerSourceActionResultSchema, {
70405
+ kind: "mutation",
70406
+ auth: "admin"
70407
+ })
70408
+ },
70409
+ runtimeState: PowerSourceStateSchema,
70410
+ customize: powerSourceCustomize,
70411
+ /**
70412
+ * Runtime-state durability: **session** — mirrored from the linked switch on
70413
+ * its next report; a restored value would outlive the reading it names.
70414
+ *
70415
+ * See `RuntimeStateDurability`. Enforced by
70416
+ * `scripts/check-runtime-state-durability.ts`.
70417
+ */
70418
+ durability: "session",
70419
+ history: "none"
70420
+ };
70232
70421
  /**
70233
70422
  * A monotonic total between resets (D944). Energy uses `power-meter.energy`
70234
70423
  * so dashboards keep one series; every other instantaneous reading lands here.
@@ -79014,6 +79203,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
79014
79203
  petFeeder: petFeederCapability,
79015
79204
  petFountain: petFountainCapability,
79016
79205
  powerMeter: powerMeterCapability,
79206
+ powerSource: powerSourceCapability,
79017
79207
  presence: presenceCapability,
79018
79208
  pressureSensor: pressureSensorCapability,
79019
79209
  privacyMask: privacyMaskCapability,
@@ -80683,6 +80873,13 @@ Object.freeze({
80683
80873
  access: "view",
80684
80874
  role: "admin"
80685
80875
  },
80876
+ "addonSettings.getIntegrationFormSchema": {
80877
+ capName: "addon-settings",
80878
+ capScope: "system",
80879
+ addonId: null,
80880
+ access: "view",
80881
+ role: "admin"
80882
+ },
80686
80883
  "addonSettings.getIntegrationSettings": {
80687
80884
  capName: "addon-settings",
80688
80885
  capScope: "system",
@@ -87403,6 +87600,34 @@ Object.freeze({
87403
87600
  access: "view",
87404
87601
  role: "viewer"
87405
87602
  },
87603
+ "powerSource.forceRestart": {
87604
+ capName: "power-source",
87605
+ capScope: "device",
87606
+ addonId: null,
87607
+ access: "create",
87608
+ role: "admin"
87609
+ },
87610
+ "powerSource.getStatus": {
87611
+ capName: "power-source",
87612
+ capScope: "device",
87613
+ addonId: null,
87614
+ access: "view",
87615
+ role: "admin"
87616
+ },
87617
+ "powerSource.powerOff": {
87618
+ capName: "power-source",
87619
+ capScope: "device",
87620
+ addonId: null,
87621
+ access: "create",
87622
+ role: "admin"
87623
+ },
87624
+ "powerSource.powerOn": {
87625
+ capName: "power-source",
87626
+ capScope: "device",
87627
+ addonId: null,
87628
+ access: "create",
87629
+ role: "admin"
87630
+ },
87406
87631
  "presence.getStatus": {
87407
87632
  capName: "presence",
87408
87633
  capScope: "device",
@@ -92562,6 +92787,26 @@ Object.freeze({
92562
92787
  form: "single",
92563
92788
  optional: false
92564
92789
  }],
92790
+ "powerSource.forceRestart": [{
92791
+ name: "deviceId",
92792
+ form: "single",
92793
+ optional: false
92794
+ }],
92795
+ "powerSource.getStatus": [{
92796
+ name: "deviceId",
92797
+ form: "single",
92798
+ optional: false
92799
+ }],
92800
+ "powerSource.powerOff": [{
92801
+ name: "deviceId",
92802
+ form: "single",
92803
+ optional: false
92804
+ }],
92805
+ "powerSource.powerOn": [{
92806
+ name: "deviceId",
92807
+ form: "single",
92808
+ optional: false
92809
+ }],
92565
92810
  "presence.getStatus": [{
92566
92811
  name: "deviceId",
92567
92812
  form: "single",
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
  //#endregion
27
- const require_ha_broker_source = require("../ha-broker-source-B6xSmZ6H.js");
27
+ const require_ha_broker_source = require("../ha-broker-source-zbaephU5.js");
28
28
  let node_crypto = require("node:crypto");
29
29
  require("node:zlib");
30
30
  let node_fs = require("node:fs");
@@ -3485,6 +3485,10 @@ function controlEntitySpecs(slice, quantity) {
3485
3485
  }, kindExtra];
3486
3486
  }
3487
3487
  var CAPS_NOT_EXPORTED = [
3488
+ {
3489
+ cap: "power-source",
3490
+ reason: "A manual admin recovery action (cut the power of a device that hangs) on a switch that is already exported as itself; publishing a restart button beside it would hand an ecosystem the means to cut a device off by mistake."
3491
+ },
3488
3492
  {
3489
3493
  cap: "pet-fountain",
3490
3494
  reason: "A fountain is BUILT here from the loose entities Home Assistant already holds (a pump switch, two number boxes, a button), so exporting it back would publish a second copy of entities that already exist there. A dedicated mapping can follow when an ecosystem asks for the built device."
@@ -1,4 +1,4 @@
1
- import { $t as array, B as consumableKindOf, Et as sendToExportedTarget, Gt as baseUnitOf, K as deviceExportCapability, Ut as BaseAddon, Xt as isReadingQuantity, Zt as nodePin, _ as PLUG_APPLIANCE_TYPES, bt as runExportedAction, c as COCO_TO_MACRO, cn as unknown, d as ConsumableItemSchema, f as ConsumableStatusSchema, g as MediaPlayerRepeatSchema, gt as pruneDeletedEntities, h as HvacModeSchema, i as AlarmArmModeSchema, in as object, j as buildAddonRouteProvider, l as CameraSwitchIdSchema, m as FanDirectionSchema, on as string, r as listHomeAssistantBrokers, s as CAMERA_SWITCH_ORDER, u as ConsumableFormSchema, un as EventCategory, ut as oauthIntegrationCapability, x as addonRoutesCapability, z as consumableFormOf } from "../ha-broker-source-D9_yzN2c.mjs";
1
+ import { $t as array, B as consumableKindOf, Et as sendToExportedTarget, Gt as baseUnitOf, K as deviceExportCapability, Ut as BaseAddon, Xt as isReadingQuantity, Zt as nodePin, _ as PLUG_APPLIANCE_TYPES, bt as runExportedAction, c as COCO_TO_MACRO, cn as unknown, d as ConsumableItemSchema, f as ConsumableStatusSchema, g as MediaPlayerRepeatSchema, gt as pruneDeletedEntities, h as HvacModeSchema, i as AlarmArmModeSchema, in as object, j as buildAddonRouteProvider, l as CameraSwitchIdSchema, m as FanDirectionSchema, on as string, r as listHomeAssistantBrokers, s as CAMERA_SWITCH_ORDER, u as ConsumableFormSchema, un as EventCategory, ut as oauthIntegrationCapability, x as addonRoutesCapability, z as consumableFormOf } from "../ha-broker-source-DxSvfCed.mjs";
2
2
  import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  import "node:zlib";
4
4
  import "node:fs";
@@ -3450,6 +3450,10 @@ function controlEntitySpecs(slice, quantity) {
3450
3450
  }, kindExtra];
3451
3451
  }
3452
3452
  var CAPS_NOT_EXPORTED = [
3453
+ {
3454
+ cap: "power-source",
3455
+ reason: "A manual admin recovery action (cut the power of a device that hangs) on a switch that is already exported as itself; publishing a restart button beside it would hand an ecosystem the means to cut a device off by mistake."
3456
+ },
3453
3457
  {
3454
3458
  cap: "pet-fountain",
3455
3459
  reason: "A fountain is BUILT here from the loose entities Home Assistant already holds (a pump switch, two number boxes, a button), so exporting it back would publish a second copy of entities that already exist there. A dedicated mapping can follow when an ecosystem asks for the built device."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-homeassistant",
3
- "version": "1.2.642",
3
+ "version": "1.2.643",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",