@camstack/addon-provider-homeassistant 1.2.63 → 1.2.65

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-D8uo_M4x.js");
2
+ const require_dist = require("./dist-hXonkb3t.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-COgdwHQp.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-Ddc6B6iE.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
@@ -16247,6 +16247,8 @@ var NcSystemEventKindSchema = _enum([
16247
16247
  "device-offline",
16248
16248
  "device-disabled",
16249
16249
  "device-enabled",
16250
+ "device-battery-low",
16251
+ "device-battery-normal",
16250
16252
  "stream-online",
16251
16253
  "stream-offline",
16252
16254
  "node-online",
@@ -19577,6 +19579,34 @@ var KeyEventsForDeviceSchema = object({
19577
19579
  deviceId: number(),
19578
19580
  events: array(KeyEventSchema).readonly()
19579
19581
  });
19582
+ /** One non-empty bucket of the timeline histogram. */
19583
+ var EventDensityBucketSchema = object({
19584
+ bucketStart: number(),
19585
+ motion: number().int(),
19586
+ object: number().int(),
19587
+ audio: number().int()
19588
+ });
19589
+ /**
19590
+ * One camera's row in a `getEventDensityBatch` answer.
19591
+ *
19592
+ * TWO facts, and the timeline draws them differently:
19593
+ *
19594
+ * - `read: 'read'` — the histogram for this camera. `buckets: []` is a real
19595
+ * claim: read, and nothing happened in the window.
19596
+ * - `read: 'unreadable'` — nobody could answer for this camera. `buckets` is
19597
+ * empty and that emptiness means NOTHING; the timeline must render unknown,
19598
+ * not quiet.
19599
+ *
19600
+ * Fanned out per camera the difference was free — one query rejected while the
19601
+ * others resolved — and collapsing to a batch is the exact moment it is lost
19602
+ * silently. Every requested id gets a row: a caller that asked for twelve and
19603
+ * got eleven cannot tell which one is missing, or that any is.
19604
+ */
19605
+ var EventDensityForDeviceSchema = object({
19606
+ deviceId: number(),
19607
+ read: _enum(["read", "unreadable"]),
19608
+ buckets: array(EventDensityBucketSchema).readonly()
19609
+ });
19580
19610
  object({
19581
19611
  trackId: string(),
19582
19612
  className: string(),
@@ -19887,12 +19917,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19887
19917
  since: number(),
19888
19918
  until: number(),
19889
19919
  bucketMs: number().int().positive()
19890
- }), array(object({
19891
- bucketStart: number(),
19892
- motion: number().int(),
19893
- object: number().int(),
19894
- audio: number().int()
19895
- })).readonly()), method(object({
19920
+ }), array(EventDensityBucketSchema).readonly()), method(object({
19921
+ deviceIds: array(number()).min(1).max(200),
19922
+ since: number(),
19923
+ until: number(),
19924
+ bucketMs: number().int().positive()
19925
+ }), array(EventDensityForDeviceSchema).readonly()), method(object({
19896
19926
  deviceId: number(),
19897
19927
  cutoffMs: number()
19898
19928
  }), object({
@@ -29006,6 +29036,39 @@ var RecordingDaysSchema = object({
29006
29036
  /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
29007
29037
  days: array(number())
29008
29038
  });
29039
+ /**
29040
+ * One camera's row in a `getAvailabilityBatch` answer.
29041
+ *
29042
+ * `ranges` is EXACTLY what `getAvailability` returns for that camera — the
29043
+ * batch collapses the transport, not the work — plus the one thing the singular
29044
+ * method never had to say:
29045
+ *
29046
+ * - `read: 'read'` — answered. `ranges: []` means "read, and this camera has
29047
+ * no footage in the window", which is a real claim.
29048
+ * - `read: 'unreadable'` — the recorder could not answer for this camera (its
29049
+ * calendar rung threw, its location is unmounted). `ranges` is empty and
29050
+ * that emptiness means NOTHING.
29051
+ *
29052
+ * A timeline that renders the second as the first tells an operator there is no
29053
+ * footage when the truth is that nobody looked.
29054
+ */
29055
+ var RecordingAvailabilityForDeviceSchema = object({
29056
+ deviceId: number(),
29057
+ read: _enum(["read", "unreadable"]),
29058
+ ranges: array(RecordingRangeSchema).readonly()
29059
+ });
29060
+ /**
29061
+ * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
29062
+ * {@link RecordingAvailabilityForDeviceSchema}: `days: []` on a `'read'` row is
29063
+ * "no footage in this month", `read: 'unreadable'` is "nobody could look", and
29064
+ * the date-picker's day dots must not spell them the same.
29065
+ */
29066
+ var RecordingDaysForDeviceSchema = object({
29067
+ deviceId: number(),
29068
+ read: _enum(["read", "unreadable"]),
29069
+ /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
29070
+ days: array(number()).readonly()
29071
+ });
29009
29072
  var RecordingManifestSchema = object({
29010
29073
  deviceId: number(),
29011
29074
  /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
@@ -29240,6 +29303,13 @@ method(object({
29240
29303
  }), RecordingAvailabilitySchema, {
29241
29304
  kind: "query",
29242
29305
  auth: "protected"
29306
+ }), method(object({
29307
+ deviceIds: array(number()).min(1).max(200),
29308
+ fromMs: number(),
29309
+ toMs: number()
29310
+ }), array(RecordingAvailabilityForDeviceSchema).readonly(), {
29311
+ kind: "query",
29312
+ auth: "protected"
29243
29313
  }), method(object({
29244
29314
  deviceId: number(),
29245
29315
  fromMs: number(),
@@ -29248,6 +29318,14 @@ method(object({
29248
29318
  }), RecordingDaysSchema, {
29249
29319
  kind: "query",
29250
29320
  auth: "protected"
29321
+ }), method(object({
29322
+ deviceIds: array(number()).min(1).max(200),
29323
+ fromMs: number(),
29324
+ toMs: number(),
29325
+ tzOffsetMinutes: number()
29326
+ }), array(RecordingDaysForDeviceSchema).readonly(), {
29327
+ kind: "query",
29328
+ auth: "protected"
29251
29329
  }), method(object({
29252
29330
  deviceId: number(),
29253
29331
  fromMs: number(),
@@ -36144,6 +36222,12 @@ Object.freeze({
36144
36222
  addonId: null,
36145
36223
  access: "view"
36146
36224
  },
36225
+ "pipelineAnalytics.getEventDensityBatch": {
36226
+ capName: "pipeline-analytics",
36227
+ capScope: "device",
36228
+ addonId: null,
36229
+ access: "view"
36230
+ },
36147
36231
  "pipelineAnalytics.getEventMedia": {
36148
36232
  capName: "pipeline-analytics",
36149
36233
  capScope: "device",
@@ -37266,12 +37350,24 @@ Object.freeze({
37266
37350
  addonId: null,
37267
37351
  access: "view"
37268
37352
  },
37353
+ "recording.getAvailabilityBatch": {
37354
+ capName: "recording",
37355
+ capScope: "system",
37356
+ addonId: null,
37357
+ access: "view"
37358
+ },
37269
37359
  "recording.getDaysWithRecordings": {
37270
37360
  capName: "recording",
37271
37361
  capScope: "system",
37272
37362
  addonId: null,
37273
37363
  access: "view"
37274
37364
  },
37365
+ "recording.getDaysWithRecordingsBatch": {
37366
+ capName: "recording",
37367
+ capScope: "system",
37368
+ addonId: null,
37369
+ access: "view"
37370
+ },
37275
37371
  "recording.getDeviceConfig": {
37276
37372
  capName: "recording",
37277
37373
  capScope: "system",
@@ -39876,6 +39972,11 @@ Object.freeze({
39876
39972
  form: "single",
39877
39973
  optional: false
39878
39974
  }],
39975
+ "pipelineAnalytics.getEventDensityBatch": [{
39976
+ name: "deviceIds",
39977
+ form: "array",
39978
+ optional: false
39979
+ }],
39879
39980
  "pipelineAnalytics.getEventMedia": [{
39880
39981
  name: "deviceId",
39881
39982
  form: "single",
@@ -40291,11 +40392,21 @@ Object.freeze({
40291
40392
  form: "single",
40292
40393
  optional: false
40293
40394
  }],
40395
+ "recording.getAvailabilityBatch": [{
40396
+ name: "deviceIds",
40397
+ form: "array",
40398
+ optional: false
40399
+ }],
40294
40400
  "recording.getDaysWithRecordings": [{
40295
40401
  name: "deviceId",
40296
40402
  form: "single",
40297
40403
  optional: false
40298
40404
  }],
40405
+ "recording.getDaysWithRecordingsBatch": [{
40406
+ name: "deviceIds",
40407
+ form: "array",
40408
+ optional: false
40409
+ }],
40299
40410
  "recording.getDeviceConfig": [{
40300
40411
  name: "deviceId",
40301
40412
  form: "single",
@@ -16247,6 +16247,8 @@ var NcSystemEventKindSchema = _enum([
16247
16247
  "device-offline",
16248
16248
  "device-disabled",
16249
16249
  "device-enabled",
16250
+ "device-battery-low",
16251
+ "device-battery-normal",
16250
16252
  "stream-online",
16251
16253
  "stream-offline",
16252
16254
  "node-online",
@@ -19577,6 +19579,34 @@ var KeyEventsForDeviceSchema = object({
19577
19579
  deviceId: number(),
19578
19580
  events: array(KeyEventSchema).readonly()
19579
19581
  });
19582
+ /** One non-empty bucket of the timeline histogram. */
19583
+ var EventDensityBucketSchema = object({
19584
+ bucketStart: number(),
19585
+ motion: number().int(),
19586
+ object: number().int(),
19587
+ audio: number().int()
19588
+ });
19589
+ /**
19590
+ * One camera's row in a `getEventDensityBatch` answer.
19591
+ *
19592
+ * TWO facts, and the timeline draws them differently:
19593
+ *
19594
+ * - `read: 'read'` — the histogram for this camera. `buckets: []` is a real
19595
+ * claim: read, and nothing happened in the window.
19596
+ * - `read: 'unreadable'` — nobody could answer for this camera. `buckets` is
19597
+ * empty and that emptiness means NOTHING; the timeline must render unknown,
19598
+ * not quiet.
19599
+ *
19600
+ * Fanned out per camera the difference was free — one query rejected while the
19601
+ * others resolved — and collapsing to a batch is the exact moment it is lost
19602
+ * silently. Every requested id gets a row: a caller that asked for twelve and
19603
+ * got eleven cannot tell which one is missing, or that any is.
19604
+ */
19605
+ var EventDensityForDeviceSchema = object({
19606
+ deviceId: number(),
19607
+ read: _enum(["read", "unreadable"]),
19608
+ buckets: array(EventDensityBucketSchema).readonly()
19609
+ });
19580
19610
  object({
19581
19611
  trackId: string(),
19582
19612
  className: string(),
@@ -19887,12 +19917,12 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19887
19917
  since: number(),
19888
19918
  until: number(),
19889
19919
  bucketMs: number().int().positive()
19890
- }), array(object({
19891
- bucketStart: number(),
19892
- motion: number().int(),
19893
- object: number().int(),
19894
- audio: number().int()
19895
- })).readonly()), method(object({
19920
+ }), array(EventDensityBucketSchema).readonly()), method(object({
19921
+ deviceIds: array(number()).min(1).max(200),
19922
+ since: number(),
19923
+ until: number(),
19924
+ bucketMs: number().int().positive()
19925
+ }), array(EventDensityForDeviceSchema).readonly()), method(object({
19896
19926
  deviceId: number(),
19897
19927
  cutoffMs: number()
19898
19928
  }), object({
@@ -29006,6 +29036,39 @@ var RecordingDaysSchema = object({
29006
29036
  /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
29007
29037
  days: array(number())
29008
29038
  });
29039
+ /**
29040
+ * One camera's row in a `getAvailabilityBatch` answer.
29041
+ *
29042
+ * `ranges` is EXACTLY what `getAvailability` returns for that camera — the
29043
+ * batch collapses the transport, not the work — plus the one thing the singular
29044
+ * method never had to say:
29045
+ *
29046
+ * - `read: 'read'` — answered. `ranges: []` means "read, and this camera has
29047
+ * no footage in the window", which is a real claim.
29048
+ * - `read: 'unreadable'` — the recorder could not answer for this camera (its
29049
+ * calendar rung threw, its location is unmounted). `ranges` is empty and
29050
+ * that emptiness means NOTHING.
29051
+ *
29052
+ * A timeline that renders the second as the first tells an operator there is no
29053
+ * footage when the truth is that nobody looked.
29054
+ */
29055
+ var RecordingAvailabilityForDeviceSchema = object({
29056
+ deviceId: number(),
29057
+ read: _enum(["read", "unreadable"]),
29058
+ ranges: array(RecordingRangeSchema).readonly()
29059
+ });
29060
+ /**
29061
+ * One camera's row in a `getDaysWithRecordingsBatch` answer. Same rule as
29062
+ * {@link RecordingAvailabilityForDeviceSchema}: `days: []` on a `'read'` row is
29063
+ * "no footage in this month", `read: 'unreadable'` is "nobody could look", and
29064
+ * the date-picker's day dots must not spell them the same.
29065
+ */
29066
+ var RecordingDaysForDeviceSchema = object({
29067
+ deviceId: number(),
29068
+ read: _enum(["read", "unreadable"]),
29069
+ /** Local-midnight epochs (UTC ms) of days that have ≥1 recorded segment. */
29070
+ days: array(number()).readonly()
29071
+ });
29009
29072
  var RecordingManifestSchema = object({
29010
29073
  deviceId: number(),
29011
29074
  /** Local filesystem path to the master playlist; null when no recording exists for the requested range. */
@@ -29240,6 +29303,13 @@ method(object({
29240
29303
  }), RecordingAvailabilitySchema, {
29241
29304
  kind: "query",
29242
29305
  auth: "protected"
29306
+ }), method(object({
29307
+ deviceIds: array(number()).min(1).max(200),
29308
+ fromMs: number(),
29309
+ toMs: number()
29310
+ }), array(RecordingAvailabilityForDeviceSchema).readonly(), {
29311
+ kind: "query",
29312
+ auth: "protected"
29243
29313
  }), method(object({
29244
29314
  deviceId: number(),
29245
29315
  fromMs: number(),
@@ -29248,6 +29318,14 @@ method(object({
29248
29318
  }), RecordingDaysSchema, {
29249
29319
  kind: "query",
29250
29320
  auth: "protected"
29321
+ }), method(object({
29322
+ deviceIds: array(number()).min(1).max(200),
29323
+ fromMs: number(),
29324
+ toMs: number(),
29325
+ tzOffsetMinutes: number()
29326
+ }), array(RecordingDaysForDeviceSchema).readonly(), {
29327
+ kind: "query",
29328
+ auth: "protected"
29251
29329
  }), method(object({
29252
29330
  deviceId: number(),
29253
29331
  fromMs: number(),
@@ -36144,6 +36222,12 @@ Object.freeze({
36144
36222
  addonId: null,
36145
36223
  access: "view"
36146
36224
  },
36225
+ "pipelineAnalytics.getEventDensityBatch": {
36226
+ capName: "pipeline-analytics",
36227
+ capScope: "device",
36228
+ addonId: null,
36229
+ access: "view"
36230
+ },
36147
36231
  "pipelineAnalytics.getEventMedia": {
36148
36232
  capName: "pipeline-analytics",
36149
36233
  capScope: "device",
@@ -37266,12 +37350,24 @@ Object.freeze({
37266
37350
  addonId: null,
37267
37351
  access: "view"
37268
37352
  },
37353
+ "recording.getAvailabilityBatch": {
37354
+ capName: "recording",
37355
+ capScope: "system",
37356
+ addonId: null,
37357
+ access: "view"
37358
+ },
37269
37359
  "recording.getDaysWithRecordings": {
37270
37360
  capName: "recording",
37271
37361
  capScope: "system",
37272
37362
  addonId: null,
37273
37363
  access: "view"
37274
37364
  },
37365
+ "recording.getDaysWithRecordingsBatch": {
37366
+ capName: "recording",
37367
+ capScope: "system",
37368
+ addonId: null,
37369
+ access: "view"
37370
+ },
37275
37371
  "recording.getDeviceConfig": {
37276
37372
  capName: "recording",
37277
37373
  capScope: "system",
@@ -39876,6 +39972,11 @@ Object.freeze({
39876
39972
  form: "single",
39877
39973
  optional: false
39878
39974
  }],
39975
+ "pipelineAnalytics.getEventDensityBatch": [{
39976
+ name: "deviceIds",
39977
+ form: "array",
39978
+ optional: false
39979
+ }],
39879
39980
  "pipelineAnalytics.getEventMedia": [{
39880
39981
  name: "deviceId",
39881
39982
  form: "single",
@@ -40291,11 +40392,21 @@ Object.freeze({
40291
40392
  form: "single",
40292
40393
  optional: false
40293
40394
  }],
40395
+ "recording.getAvailabilityBatch": [{
40396
+ name: "deviceIds",
40397
+ form: "array",
40398
+ optional: false
40399
+ }],
40294
40400
  "recording.getDaysWithRecordings": [{
40295
40401
  name: "deviceId",
40296
40402
  form: "single",
40297
40403
  optional: false
40298
40404
  }],
40405
+ "recording.getDaysWithRecordingsBatch": [{
40406
+ name: "deviceIds",
40407
+ form: "array",
40408
+ optional: false
40409
+ }],
40299
40410
  "recording.getDeviceConfig": [{
40300
40411
  name: "deviceId",
40301
40412
  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-D8uo_M4x.js");
6
+ const require_dist = require("../dist-hXonkb3t.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-COgdwHQp.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-Ddc6B6iE.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.63",
3
+ "version": "1.2.65",
4
4
  "description": "Home Assistant device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",