@camstack/addon-provider-homeassistant 1.2.161 → 1.2.162
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 +61 -12
- package/dist/addon.mjs +61 -12
- package/dist/{dist-B1FEp9mY.mjs → dist-Cw91Z1Ew.mjs} +30 -20
- package/dist/{dist-C3T2aMHG.js → dist-WoiCiuhv.js} +30 -20
- package/dist/ha-export/ha-export.addon.js +12 -10
- package/dist/ha-export/ha-export.addon.mjs +12 -10
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-WoiCiuhv.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
|
|
@@ -486,7 +486,7 @@ var HaBaseChildDevice = class HaBaseChildDevice extends require_dist.BaseDevice
|
|
|
486
486
|
* device's cap-state slice and persist via `this.runtimeState`.
|
|
487
487
|
* Called on every WS push matching this entity. Default: no-op.
|
|
488
488
|
*/
|
|
489
|
-
handleStatePush(_state) {}
|
|
489
|
+
handleStatePush(_state, _push) {}
|
|
490
490
|
/**
|
|
491
491
|
* Issue an HA service call for this device's entity. The target's
|
|
492
492
|
* entity_id is pinned to `this.entityId` automatically. Returns the
|
|
@@ -566,6 +566,7 @@ var HaBaseChildDevice = class HaBaseChildDevice extends require_dist.BaseDevice
|
|
|
566
566
|
this.lastLoggedState = state.state;
|
|
567
567
|
}
|
|
568
568
|
const reachable = state.state !== "unavailable" && state.state !== "unknown";
|
|
569
|
+
const push = { afterOutage: reachable && !this.online };
|
|
569
570
|
if (this.online !== reachable) {
|
|
570
571
|
this.deviceLogger.info("HA→device online transition", { meta: {
|
|
571
572
|
entityId: this.entityId,
|
|
@@ -575,7 +576,7 @@ var HaBaseChildDevice = class HaBaseChildDevice extends require_dist.BaseDevice
|
|
|
575
576
|
this.markOnline(reachable);
|
|
576
577
|
}
|
|
577
578
|
try {
|
|
578
|
-
this.handleStatePush(state);
|
|
579
|
+
this.handleStatePush(state, push);
|
|
579
580
|
} catch (err) {
|
|
580
581
|
this.deviceLogger.warn("ha-child state-push handler error", { meta: {
|
|
581
582
|
entityId: this.entityId,
|
|
@@ -930,6 +931,22 @@ function pickSupportedCap(capabilities) {
|
|
|
930
931
|
function hostsNumericSensor(capabilities) {
|
|
931
932
|
return capabilities.some((c) => SUPPORTED_CAP_NAMES$1.includes(c));
|
|
932
933
|
}
|
|
934
|
+
function haChangeStamp(input) {
|
|
935
|
+
const prior = input.priorChangedAt;
|
|
936
|
+
const priorKnown = prior !== void 0 && Number.isFinite(prior) && prior > 0;
|
|
937
|
+
if (priorKnown && input.sameValue) return {
|
|
938
|
+
kind: "kept",
|
|
939
|
+
at: prior
|
|
940
|
+
};
|
|
941
|
+
if (!priorKnown && input.afterOutage) return {
|
|
942
|
+
kind: "seeded",
|
|
943
|
+
at: 1
|
|
944
|
+
};
|
|
945
|
+
return {
|
|
946
|
+
kind: "ha",
|
|
947
|
+
at: input.haChangedAt
|
|
948
|
+
};
|
|
949
|
+
}
|
|
933
950
|
//#endregion
|
|
934
951
|
//#region src/devices/ha-binary-sensor-device.ts
|
|
935
952
|
var SUPPORTED_CAP_NAMES = [
|
|
@@ -968,12 +985,22 @@ var HaBinarySensorDevice = class extends HaBaseChildDevice {
|
|
|
968
985
|
const seededChangedAt = storedChangedAt(capName, stored) ?? 0;
|
|
969
986
|
this.runtimeState.setCapState(this.capName, buildSlice(capName, seededActive, seededChangedAt, stored));
|
|
970
987
|
}
|
|
971
|
-
handleStatePush(state) {
|
|
988
|
+
handleStatePush(state, push) {
|
|
972
989
|
if (state.state === "unavailable" || state.state === "unknown") return;
|
|
973
990
|
const active = state.state === "on";
|
|
974
|
-
const lastChangedAt = Date.parse(state.last_changed) || Date.now();
|
|
975
991
|
const prior = this.runtimeState.getCapState(this.capName);
|
|
976
|
-
|
|
992
|
+
const stamp = haChangeStamp({
|
|
993
|
+
sameValue: storedActiveLevel(this.capName, prior) === active,
|
|
994
|
+
priorChangedAt: storedChangedAt(this.capName, prior),
|
|
995
|
+
haChangedAt: Date.parse(state.last_changed) || Date.now(),
|
|
996
|
+
afterOutage: push.afterOutage
|
|
997
|
+
});
|
|
998
|
+
if (stamp.kind === "seeded") this.deviceLogger.info("HA→device recovery with no known prior value — no change time", { meta: {
|
|
999
|
+
entityId: this.entityId,
|
|
1000
|
+
cap: this.capName,
|
|
1001
|
+
value: state.state
|
|
1002
|
+
} });
|
|
1003
|
+
this.runtimeState.setCapState(this.capName, buildSlice(this.capName, active, stamp.at, prior));
|
|
977
1004
|
}
|
|
978
1005
|
registerCap(name) {
|
|
979
1006
|
switch (name) {
|
|
@@ -1335,18 +1362,29 @@ var HaCoverDevice = class extends HaBaseChildDevice {
|
|
|
1335
1362
|
this.registerCoverCap();
|
|
1336
1363
|
this.runtimeState.setCapState("cover", COLD_START$18);
|
|
1337
1364
|
}
|
|
1338
|
-
handleStatePush(state) {
|
|
1365
|
+
handleStatePush(state, push) {
|
|
1339
1366
|
if (state.state === "unavailable" || state.state === "unknown") return;
|
|
1340
|
-
const lastChangedAt = Date.parse(state.last_changed) || Date.now();
|
|
1341
1367
|
const lifecycleState = mapHaStateToCoverState(state.state);
|
|
1342
1368
|
if (lifecycleState === null) return;
|
|
1343
1369
|
const position = readNumericAttr$4(state.attributes, "current_position");
|
|
1344
1370
|
const tilt = readNumericAttr$4(state.attributes, "current_tilt_position");
|
|
1371
|
+
const prior = this.runtimeState.getCapState("cover");
|
|
1372
|
+
const stamp = haChangeStamp({
|
|
1373
|
+
sameValue: prior?.state === lifecycleState,
|
|
1374
|
+
priorChangedAt: prior?.lastChangedAt,
|
|
1375
|
+
haChangedAt: Date.parse(state.last_changed) || Date.now(),
|
|
1376
|
+
afterOutage: push.afterOutage
|
|
1377
|
+
});
|
|
1378
|
+
if (stamp.kind === "seeded") this.deviceLogger.info("HA→device recovery with no known prior value — no change time", { meta: {
|
|
1379
|
+
entityId: this.entityId,
|
|
1380
|
+
cap: "cover",
|
|
1381
|
+
value: state.state
|
|
1382
|
+
} });
|
|
1345
1383
|
this.runtimeState.setCapState("cover", {
|
|
1346
1384
|
state: lifecycleState,
|
|
1347
1385
|
position,
|
|
1348
1386
|
tiltPosition: tilt,
|
|
1349
|
-
lastChangedAt
|
|
1387
|
+
lastChangedAt: stamp.at
|
|
1350
1388
|
});
|
|
1351
1389
|
}
|
|
1352
1390
|
registerCoverCap() {
|
|
@@ -1473,14 +1511,25 @@ var HaLockDevice = class extends HaBaseChildDevice {
|
|
|
1473
1511
|
this.registerLockCap();
|
|
1474
1512
|
this.runtimeState.setCapState("lock-control", COLD_START$16);
|
|
1475
1513
|
}
|
|
1476
|
-
handleStatePush(state) {
|
|
1514
|
+
handleStatePush(state, push) {
|
|
1477
1515
|
if (state.state === "unavailable" || state.state === "unknown") return;
|
|
1478
|
-
const lastChangedAt = Date.parse(state.last_changed) || Date.now();
|
|
1479
1516
|
const lifecycleState = mapHaStateToLockState(state.state);
|
|
1480
1517
|
if (lifecycleState === null) return;
|
|
1518
|
+
const prior = this.runtimeState.getCapState("lock-control");
|
|
1519
|
+
const stamp = haChangeStamp({
|
|
1520
|
+
sameValue: prior?.state === lifecycleState,
|
|
1521
|
+
priorChangedAt: prior?.lastChangedAt,
|
|
1522
|
+
haChangedAt: Date.parse(state.last_changed) || Date.now(),
|
|
1523
|
+
afterOutage: push.afterOutage
|
|
1524
|
+
});
|
|
1525
|
+
if (stamp.kind === "seeded") this.deviceLogger.info("HA→device recovery with no known prior value — no change time", { meta: {
|
|
1526
|
+
entityId: this.entityId,
|
|
1527
|
+
cap: "lock-control",
|
|
1528
|
+
value: state.state
|
|
1529
|
+
} });
|
|
1481
1530
|
this.runtimeState.setCapState("lock-control", {
|
|
1482
1531
|
state: lifecycleState,
|
|
1483
|
-
lastChangedAt
|
|
1532
|
+
lastChangedAt: stamp.at
|
|
1484
1533
|
});
|
|
1485
1534
|
}
|
|
1486
1535
|
registerLockCap() {
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as connectivityCapability, At as record, B as floodCapability, C as buildAddonRouteProvider, Ct as _enum, D as carbonMonoxideCapability, Dt as literal, E as calendarSourceCapability, Et as discriminatedUnion, F as deviceAdoptionCapability, Ft as EventCategory, G as lawnMowerControlCapability, H as humidifierCapability, J as motionCapability, K as lockControlCapability, L as enumSensorCapability, M as controlCapability, Mt as union, N as coverCapability, Nt as unknown, O as climateControlCapability, Ot as number, P as deviceAdminLinkCapability, Pt as url, Q as numericSensorCapability, R as eventEmitterCapability, S as brokerCapability, T as buttonCapability, Tt as boolean, U as humiditySensorCapability, V as gasCapability, W as imageCapability, X as notificationOutputCapability, Y as normalizeUnit, Z as notifierCapability, _ as automationControlCapability, _t as DeviceRole, at as scriptRunnerCapability, b as binaryCapability, ct as tamperCapability, d as TargetSchema, dt as vacuumControlCapability, et as parseAdminBase, f as accessoriesCapability, ft as valveCapability, g as ambientLightSensorCapability, gt as DeviceFeature, h as alarmPanelCapability, ht as weatherCapability, it as pressureSensorCapability, j as contactCapability, jt as string, k as colorCapability, kt as object, lt as temperatureSensorCapability, m as airQualitySensorCapability, mt as waterHeaterCapability, n as BaseDevice, nt as prepareNotification, ot as smokeCapability, p as addonRoutesCapability, pt as vibrationCapability, q as mediaPlayerCapability, r as BaseDeviceProvider, rt as presenceCapability, s as EnumSensorDateTimeFormatSchema, st as switchCapability, tt as powerMeterCapability, ut as updateCapability, v as batteryCapability, vt as DeviceType, w as buildDeviceAdminUrl, wt as array, x as brightnessCapability, xt as createEvent, y as bestLocationMatch, yt as errMsg, z as fanControlCapability } from "./dist-
|
|
1
|
+
import { A as connectivityCapability, At as record, B as floodCapability, C as buildAddonRouteProvider, Ct as _enum, D as carbonMonoxideCapability, Dt as literal, E as calendarSourceCapability, Et as discriminatedUnion, F as deviceAdoptionCapability, Ft as EventCategory, G as lawnMowerControlCapability, H as humidifierCapability, J as motionCapability, K as lockControlCapability, L as enumSensorCapability, M as controlCapability, Mt as union, N as coverCapability, Nt as unknown, O as climateControlCapability, Ot as number, P as deviceAdminLinkCapability, Pt as url, Q as numericSensorCapability, R as eventEmitterCapability, S as brokerCapability, T as buttonCapability, Tt as boolean, U as humiditySensorCapability, V as gasCapability, W as imageCapability, X as notificationOutputCapability, Y as normalizeUnit, Z as notifierCapability, _ as automationControlCapability, _t as DeviceRole, at as scriptRunnerCapability, b as binaryCapability, ct as tamperCapability, d as TargetSchema, dt as vacuumControlCapability, et as parseAdminBase, f as accessoriesCapability, ft as valveCapability, g as ambientLightSensorCapability, gt as DeviceFeature, h as alarmPanelCapability, ht as weatherCapability, it as pressureSensorCapability, j as contactCapability, jt as string, k as colorCapability, kt as object, lt as temperatureSensorCapability, m as airQualitySensorCapability, mt as waterHeaterCapability, n as BaseDevice, nt as prepareNotification, ot as smokeCapability, p as addonRoutesCapability, pt as vibrationCapability, q as mediaPlayerCapability, r as BaseDeviceProvider, rt as presenceCapability, s as EnumSensorDateTimeFormatSchema, st as switchCapability, tt as powerMeterCapability, ut as updateCapability, v as batteryCapability, vt as DeviceType, w as buildDeviceAdminUrl, wt as array, x as brightnessCapability, xt as createEvent, y as bestLocationMatch, yt as errMsg, z as fanControlCapability } from "./dist-Cw91Z1Ew.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
|
|
@@ -485,7 +485,7 @@ var HaBaseChildDevice = class HaBaseChildDevice extends BaseDevice {
|
|
|
485
485
|
* device's cap-state slice and persist via `this.runtimeState`.
|
|
486
486
|
* Called on every WS push matching this entity. Default: no-op.
|
|
487
487
|
*/
|
|
488
|
-
handleStatePush(_state) {}
|
|
488
|
+
handleStatePush(_state, _push) {}
|
|
489
489
|
/**
|
|
490
490
|
* Issue an HA service call for this device's entity. The target's
|
|
491
491
|
* entity_id is pinned to `this.entityId` automatically. Returns the
|
|
@@ -565,6 +565,7 @@ var HaBaseChildDevice = class HaBaseChildDevice extends BaseDevice {
|
|
|
565
565
|
this.lastLoggedState = state.state;
|
|
566
566
|
}
|
|
567
567
|
const reachable = state.state !== "unavailable" && state.state !== "unknown";
|
|
568
|
+
const push = { afterOutage: reachable && !this.online };
|
|
568
569
|
if (this.online !== reachable) {
|
|
569
570
|
this.deviceLogger.info("HA→device online transition", { meta: {
|
|
570
571
|
entityId: this.entityId,
|
|
@@ -574,7 +575,7 @@ var HaBaseChildDevice = class HaBaseChildDevice extends BaseDevice {
|
|
|
574
575
|
this.markOnline(reachable);
|
|
575
576
|
}
|
|
576
577
|
try {
|
|
577
|
-
this.handleStatePush(state);
|
|
578
|
+
this.handleStatePush(state, push);
|
|
578
579
|
} catch (err) {
|
|
579
580
|
this.deviceLogger.warn("ha-child state-push handler error", { meta: {
|
|
580
581
|
entityId: this.entityId,
|
|
@@ -929,6 +930,22 @@ function pickSupportedCap(capabilities) {
|
|
|
929
930
|
function hostsNumericSensor(capabilities) {
|
|
930
931
|
return capabilities.some((c) => SUPPORTED_CAP_NAMES$1.includes(c));
|
|
931
932
|
}
|
|
933
|
+
function haChangeStamp(input) {
|
|
934
|
+
const prior = input.priorChangedAt;
|
|
935
|
+
const priorKnown = prior !== void 0 && Number.isFinite(prior) && prior > 0;
|
|
936
|
+
if (priorKnown && input.sameValue) return {
|
|
937
|
+
kind: "kept",
|
|
938
|
+
at: prior
|
|
939
|
+
};
|
|
940
|
+
if (!priorKnown && input.afterOutage) return {
|
|
941
|
+
kind: "seeded",
|
|
942
|
+
at: 1
|
|
943
|
+
};
|
|
944
|
+
return {
|
|
945
|
+
kind: "ha",
|
|
946
|
+
at: input.haChangedAt
|
|
947
|
+
};
|
|
948
|
+
}
|
|
932
949
|
//#endregion
|
|
933
950
|
//#region src/devices/ha-binary-sensor-device.ts
|
|
934
951
|
var SUPPORTED_CAP_NAMES = [
|
|
@@ -967,12 +984,22 @@ var HaBinarySensorDevice = class extends HaBaseChildDevice {
|
|
|
967
984
|
const seededChangedAt = storedChangedAt(capName, stored) ?? 0;
|
|
968
985
|
this.runtimeState.setCapState(this.capName, buildSlice(capName, seededActive, seededChangedAt, stored));
|
|
969
986
|
}
|
|
970
|
-
handleStatePush(state) {
|
|
987
|
+
handleStatePush(state, push) {
|
|
971
988
|
if (state.state === "unavailable" || state.state === "unknown") return;
|
|
972
989
|
const active = state.state === "on";
|
|
973
|
-
const lastChangedAt = Date.parse(state.last_changed) || Date.now();
|
|
974
990
|
const prior = this.runtimeState.getCapState(this.capName);
|
|
975
|
-
|
|
991
|
+
const stamp = haChangeStamp({
|
|
992
|
+
sameValue: storedActiveLevel(this.capName, prior) === active,
|
|
993
|
+
priorChangedAt: storedChangedAt(this.capName, prior),
|
|
994
|
+
haChangedAt: Date.parse(state.last_changed) || Date.now(),
|
|
995
|
+
afterOutage: push.afterOutage
|
|
996
|
+
});
|
|
997
|
+
if (stamp.kind === "seeded") this.deviceLogger.info("HA→device recovery with no known prior value — no change time", { meta: {
|
|
998
|
+
entityId: this.entityId,
|
|
999
|
+
cap: this.capName,
|
|
1000
|
+
value: state.state
|
|
1001
|
+
} });
|
|
1002
|
+
this.runtimeState.setCapState(this.capName, buildSlice(this.capName, active, stamp.at, prior));
|
|
976
1003
|
}
|
|
977
1004
|
registerCap(name) {
|
|
978
1005
|
switch (name) {
|
|
@@ -1334,18 +1361,29 @@ var HaCoverDevice = class extends HaBaseChildDevice {
|
|
|
1334
1361
|
this.registerCoverCap();
|
|
1335
1362
|
this.runtimeState.setCapState("cover", COLD_START$18);
|
|
1336
1363
|
}
|
|
1337
|
-
handleStatePush(state) {
|
|
1364
|
+
handleStatePush(state, push) {
|
|
1338
1365
|
if (state.state === "unavailable" || state.state === "unknown") return;
|
|
1339
|
-
const lastChangedAt = Date.parse(state.last_changed) || Date.now();
|
|
1340
1366
|
const lifecycleState = mapHaStateToCoverState(state.state);
|
|
1341
1367
|
if (lifecycleState === null) return;
|
|
1342
1368
|
const position = readNumericAttr$4(state.attributes, "current_position");
|
|
1343
1369
|
const tilt = readNumericAttr$4(state.attributes, "current_tilt_position");
|
|
1370
|
+
const prior = this.runtimeState.getCapState("cover");
|
|
1371
|
+
const stamp = haChangeStamp({
|
|
1372
|
+
sameValue: prior?.state === lifecycleState,
|
|
1373
|
+
priorChangedAt: prior?.lastChangedAt,
|
|
1374
|
+
haChangedAt: Date.parse(state.last_changed) || Date.now(),
|
|
1375
|
+
afterOutage: push.afterOutage
|
|
1376
|
+
});
|
|
1377
|
+
if (stamp.kind === "seeded") this.deviceLogger.info("HA→device recovery with no known prior value — no change time", { meta: {
|
|
1378
|
+
entityId: this.entityId,
|
|
1379
|
+
cap: "cover",
|
|
1380
|
+
value: state.state
|
|
1381
|
+
} });
|
|
1344
1382
|
this.runtimeState.setCapState("cover", {
|
|
1345
1383
|
state: lifecycleState,
|
|
1346
1384
|
position,
|
|
1347
1385
|
tiltPosition: tilt,
|
|
1348
|
-
lastChangedAt
|
|
1386
|
+
lastChangedAt: stamp.at
|
|
1349
1387
|
});
|
|
1350
1388
|
}
|
|
1351
1389
|
registerCoverCap() {
|
|
@@ -1472,14 +1510,25 @@ var HaLockDevice = class extends HaBaseChildDevice {
|
|
|
1472
1510
|
this.registerLockCap();
|
|
1473
1511
|
this.runtimeState.setCapState("lock-control", COLD_START$16);
|
|
1474
1512
|
}
|
|
1475
|
-
handleStatePush(state) {
|
|
1513
|
+
handleStatePush(state, push) {
|
|
1476
1514
|
if (state.state === "unavailable" || state.state === "unknown") return;
|
|
1477
|
-
const lastChangedAt = Date.parse(state.last_changed) || Date.now();
|
|
1478
1515
|
const lifecycleState = mapHaStateToLockState(state.state);
|
|
1479
1516
|
if (lifecycleState === null) return;
|
|
1517
|
+
const prior = this.runtimeState.getCapState("lock-control");
|
|
1518
|
+
const stamp = haChangeStamp({
|
|
1519
|
+
sameValue: prior?.state === lifecycleState,
|
|
1520
|
+
priorChangedAt: prior?.lastChangedAt,
|
|
1521
|
+
haChangedAt: Date.parse(state.last_changed) || Date.now(),
|
|
1522
|
+
afterOutage: push.afterOutage
|
|
1523
|
+
});
|
|
1524
|
+
if (stamp.kind === "seeded") this.deviceLogger.info("HA→device recovery with no known prior value — no change time", { meta: {
|
|
1525
|
+
entityId: this.entityId,
|
|
1526
|
+
cap: "lock-control",
|
|
1527
|
+
value: state.state
|
|
1528
|
+
} });
|
|
1480
1529
|
this.runtimeState.setCapState("lock-control", {
|
|
1481
1530
|
state: lifecycleState,
|
|
1482
|
-
lastChangedAt
|
|
1531
|
+
lastChangedAt: stamp.at
|
|
1483
1532
|
});
|
|
1484
1533
|
}
|
|
1485
1534
|
registerLockCap() {
|
|
@@ -16723,6 +16723,12 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
|
|
|
16723
16723
|
kind: "mutation",
|
|
16724
16724
|
auth: "admin"
|
|
16725
16725
|
});
|
|
16726
|
+
var HUB_ADDRESS_ROLES = [
|
|
16727
|
+
"appConnections",
|
|
16728
|
+
"notificationTaps",
|
|
16729
|
+
"internal",
|
|
16730
|
+
"publicEndpoint"
|
|
16731
|
+
];
|
|
16726
16732
|
/**
|
|
16727
16733
|
* Transport bounds for AI capability methods.
|
|
16728
16734
|
*
|
|
@@ -20954,7 +20960,13 @@ var NcAlarmModeDelaysListSchema = array(object({
|
|
|
20954
20960
|
* Absent = false (logged, not sent). Even when true it is not sent when that same sensor
|
|
20955
20961
|
* is the one that starts the entry delay — the entry-delay notification already names it.
|
|
20956
20962
|
*/
|
|
20957
|
-
notifySensorRewatched: boolean().optional()
|
|
20963
|
+
notifySensorRewatched: boolean().optional(),
|
|
20964
|
+
/**
|
|
20965
|
+
* D735: notify "ignored" when a sensor this arm bypassed really MOVED while armed (its own
|
|
20966
|
+
* change time is after the arm) and set nothing off. Absent = false (logged, not sent). A
|
|
20967
|
+
* re-sync, a recovery from `unavailable` or a duplicate is never announced, switch or not.
|
|
20968
|
+
*/
|
|
20969
|
+
notifySensorIgnored: boolean().optional()
|
|
20958
20970
|
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
|
|
20959
20971
|
var NcAlarmModeDelaysEditListSchema = array(object({
|
|
20960
20972
|
mode: AlarmArmModeSchema,
|
|
@@ -20967,7 +20979,9 @@ var NcAlarmModeDelaysEditListSchema = array(object({
|
|
|
20967
20979
|
/** D706: set the switch, or `null` to clear it (back to the default, false). */
|
|
20968
20980
|
notifyDuringEntryDelay: boolean().nullable().optional(),
|
|
20969
20981
|
/** D706: set the switch, or `null` to clear it (back to the default, false). */
|
|
20970
|
-
notifySensorRewatched: boolean().nullable().optional()
|
|
20982
|
+
notifySensorRewatched: boolean().nullable().optional(),
|
|
20983
|
+
/** D735: set the switch, or `null` to clear it (back to the default, false). */
|
|
20984
|
+
notifySensorIgnored: boolean().nullable().optional()
|
|
20971
20985
|
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
|
|
20972
20986
|
/** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
|
|
20973
20987
|
var NcAlarmNonBlockingEditSchema = object({
|
|
@@ -32791,7 +32805,7 @@ var GetConnectionEndpointsResultSchema = object({
|
|
|
32791
32805
|
localPort: AdvertisedLocalPortSchema
|
|
32792
32806
|
});
|
|
32793
32807
|
/**
|
|
32794
|
-
* The address flagged for notification
|
|
32808
|
+
* The address flagged for notification taps (`notificationTaps`). `baseUrl: null` = AUTO, which
|
|
32795
32809
|
* since D709 is the CamStack app link; `resolved` reports the effective value,
|
|
32796
32810
|
* so the UI can show it either way.
|
|
32797
32811
|
*/
|
|
@@ -32826,8 +32840,8 @@ var ViewerEndpointsSchema = object({
|
|
|
32826
32840
|
});
|
|
32827
32841
|
/**
|
|
32828
32842
|
* DEPRECATED compatibility shape of `getHubAddresses` (D729 amendment, kept
|
|
32829
|
-
*
|
|
32830
|
-
*
|
|
32843
|
+
* for addons built against it): `cluster` is the `internal` role, `browser`
|
|
32844
|
+
* the `publicEndpoint` role; `override` is the flagged address.
|
|
32831
32845
|
*/
|
|
32832
32846
|
var HubAddressSnapshotSchema = object({
|
|
32833
32847
|
override: string().nullable(),
|
|
@@ -32843,15 +32857,11 @@ var HubAddressesSchema = object({
|
|
|
32843
32857
|
browser: HubAddressSnapshotSchema
|
|
32844
32858
|
});
|
|
32845
32859
|
/**
|
|
32846
|
-
* What an address is used for (`hub-address.ts
|
|
32847
|
-
* `
|
|
32860
|
+
* What an address is used for (`hub-address.ts`, D734). `appConnections` is
|
|
32861
|
+
* many-valued; `notificationTaps`, `publicEndpoint` and `internal` are carried
|
|
32862
|
+
* by at most one address.
|
|
32848
32863
|
*/
|
|
32849
|
-
var HubAddressRoleSchema = _enum(
|
|
32850
|
-
"viewer",
|
|
32851
|
-
"notifications",
|
|
32852
|
-
"agents",
|
|
32853
|
-
"signIn"
|
|
32854
|
-
]);
|
|
32864
|
+
var HubAddressRoleSchema = _enum(HUB_ADDRESS_ROLES);
|
|
32855
32865
|
var RoleSourceSchema = _enum([
|
|
32856
32866
|
"flagged",
|
|
32857
32867
|
"auto",
|
|
@@ -32865,8 +32875,8 @@ var HubAddressRoleResolutionSchema = object({
|
|
|
32865
32875
|
resolved: string().nullable(),
|
|
32866
32876
|
source: RoleSourceSchema
|
|
32867
32877
|
});
|
|
32868
|
-
var
|
|
32869
|
-
/** The addresses flagged `
|
|
32878
|
+
var HubAppConnectionsResolutionSchema = object({
|
|
32879
|
+
/** The addresses flagged `appConnections`, or empty = automatic. */
|
|
32870
32880
|
flagged: array(string()).readonly(),
|
|
32871
32881
|
/** What the apps race right now. */
|
|
32872
32882
|
resolved: array(string()).readonly(),
|
|
@@ -32886,10 +32896,10 @@ var HubAddressBookSchema = object({
|
|
|
32886
32896
|
eligible: array(HubAddressRoleSchema).readonly()
|
|
32887
32897
|
})).readonly(),
|
|
32888
32898
|
roles: object({
|
|
32889
|
-
|
|
32890
|
-
|
|
32891
|
-
|
|
32892
|
-
|
|
32899
|
+
appConnections: HubAppConnectionsResolutionSchema,
|
|
32900
|
+
notificationTaps: HubAddressRoleResolutionSchema,
|
|
32901
|
+
internal: HubAddressRoleResolutionSchema,
|
|
32902
|
+
publicEndpoint: HubAddressRoleResolutionSchema
|
|
32893
32903
|
}),
|
|
32894
32904
|
/** The `hub=` an app link carries (D709), or null. */
|
|
32895
32905
|
appLinkHub: string().nullable()
|
|
@@ -32937,7 +32947,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
|
|
|
32937
32947
|
* tunnel always emits `https://` regardless. */
|
|
32938
32948
|
scheme: _enum(["http", "https"]).optional(),
|
|
32939
32949
|
/** Append the CamStack app link entry (`kind: 'app-link'`, D709) —
|
|
32940
|
-
* an address notification
|
|
32950
|
+
* an address notification taps can be flagged with, not a hub
|
|
32941
32951
|
* route. Default `false`: racers and rankers never see it. */
|
|
32942
32952
|
includeAppLink: boolean().optional()
|
|
32943
32953
|
}), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), ViewerEndpointsSchema), method(object({ baseUrls: array(string()).readonly() }), ViewerEndpointsSchema, { kind: "mutation" }), method(object({ scheme: _enum(["http", "https"]).optional() }).optional(), HubAddressBookSchema), method(object({
|
|
@@ -16724,6 +16724,12 @@ method(_void(), array(string()).readonly(), { auth: "admin" }), method(object({
|
|
|
16724
16724
|
kind: "mutation",
|
|
16725
16725
|
auth: "admin"
|
|
16726
16726
|
});
|
|
16727
|
+
var HUB_ADDRESS_ROLES = [
|
|
16728
|
+
"appConnections",
|
|
16729
|
+
"notificationTaps",
|
|
16730
|
+
"internal",
|
|
16731
|
+
"publicEndpoint"
|
|
16732
|
+
];
|
|
16727
16733
|
/**
|
|
16728
16734
|
* Transport bounds for AI capability methods.
|
|
16729
16735
|
*
|
|
@@ -20955,7 +20961,13 @@ var NcAlarmModeDelaysListSchema = array(object({
|
|
|
20955
20961
|
* Absent = false (logged, not sent). Even when true it is not sent when that same sensor
|
|
20956
20962
|
* is the one that starts the entry delay — the entry-delay notification already names it.
|
|
20957
20963
|
*/
|
|
20958
|
-
notifySensorRewatched: boolean().optional()
|
|
20964
|
+
notifySensorRewatched: boolean().optional(),
|
|
20965
|
+
/**
|
|
20966
|
+
* D735: notify "ignored" when a sensor this arm bypassed really MOVED while armed (its own
|
|
20967
|
+
* change time is after the arm) and set nothing off. Absent = false (logged, not sent). A
|
|
20968
|
+
* re-sync, a recovery from `unavailable` or a duplicate is never announced, switch or not.
|
|
20969
|
+
*/
|
|
20970
|
+
notifySensorIgnored: boolean().optional()
|
|
20959
20971
|
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one entry per arm mode" });
|
|
20960
20972
|
var NcAlarmModeDelaysEditListSchema = array(object({
|
|
20961
20973
|
mode: AlarmArmModeSchema,
|
|
@@ -20968,7 +20980,9 @@ var NcAlarmModeDelaysEditListSchema = array(object({
|
|
|
20968
20980
|
/** D706: set the switch, or `null` to clear it (back to the default, false). */
|
|
20969
20981
|
notifyDuringEntryDelay: boolean().nullable().optional(),
|
|
20970
20982
|
/** D706: set the switch, or `null` to clear it (back to the default, false). */
|
|
20971
|
-
notifySensorRewatched: boolean().nullable().optional()
|
|
20983
|
+
notifySensorRewatched: boolean().nullable().optional(),
|
|
20984
|
+
/** D735: set the switch, or `null` to clear it (back to the default, false). */
|
|
20985
|
+
notifySensorIgnored: boolean().nullable().optional()
|
|
20972
20986
|
})).max(8).refine(uniqueModes, { message: "modeDelays: at most one edit per arm mode" });
|
|
20973
20987
|
/** One switch of the alarm table: put ONE device on, or take it off, ONE mode's list. */
|
|
20974
20988
|
var NcAlarmNonBlockingEditSchema = object({
|
|
@@ -32792,7 +32806,7 @@ var GetConnectionEndpointsResultSchema = object({
|
|
|
32792
32806
|
localPort: AdvertisedLocalPortSchema
|
|
32793
32807
|
});
|
|
32794
32808
|
/**
|
|
32795
|
-
* The address flagged for notification
|
|
32809
|
+
* The address flagged for notification taps (`notificationTaps`). `baseUrl: null` = AUTO, which
|
|
32796
32810
|
* since D709 is the CamStack app link; `resolved` reports the effective value,
|
|
32797
32811
|
* so the UI can show it either way.
|
|
32798
32812
|
*/
|
|
@@ -32827,8 +32841,8 @@ var ViewerEndpointsSchema = object({
|
|
|
32827
32841
|
});
|
|
32828
32842
|
/**
|
|
32829
32843
|
* DEPRECATED compatibility shape of `getHubAddresses` (D729 amendment, kept
|
|
32830
|
-
*
|
|
32831
|
-
*
|
|
32844
|
+
* for addons built against it): `cluster` is the `internal` role, `browser`
|
|
32845
|
+
* the `publicEndpoint` role; `override` is the flagged address.
|
|
32832
32846
|
*/
|
|
32833
32847
|
var HubAddressSnapshotSchema = object({
|
|
32834
32848
|
override: string().nullable(),
|
|
@@ -32844,15 +32858,11 @@ var HubAddressesSchema = object({
|
|
|
32844
32858
|
browser: HubAddressSnapshotSchema
|
|
32845
32859
|
});
|
|
32846
32860
|
/**
|
|
32847
|
-
* What an address is used for (`hub-address.ts
|
|
32848
|
-
* `
|
|
32861
|
+
* What an address is used for (`hub-address.ts`, D734). `appConnections` is
|
|
32862
|
+
* many-valued; `notificationTaps`, `publicEndpoint` and `internal` are carried
|
|
32863
|
+
* by at most one address.
|
|
32849
32864
|
*/
|
|
32850
|
-
var HubAddressRoleSchema = _enum(
|
|
32851
|
-
"viewer",
|
|
32852
|
-
"notifications",
|
|
32853
|
-
"agents",
|
|
32854
|
-
"signIn"
|
|
32855
|
-
]);
|
|
32865
|
+
var HubAddressRoleSchema = _enum(HUB_ADDRESS_ROLES);
|
|
32856
32866
|
var RoleSourceSchema = _enum([
|
|
32857
32867
|
"flagged",
|
|
32858
32868
|
"auto",
|
|
@@ -32866,8 +32876,8 @@ var HubAddressRoleResolutionSchema = object({
|
|
|
32866
32876
|
resolved: string().nullable(),
|
|
32867
32877
|
source: RoleSourceSchema
|
|
32868
32878
|
});
|
|
32869
|
-
var
|
|
32870
|
-
/** The addresses flagged `
|
|
32879
|
+
var HubAppConnectionsResolutionSchema = object({
|
|
32880
|
+
/** The addresses flagged `appConnections`, or empty = automatic. */
|
|
32871
32881
|
flagged: array(string()).readonly(),
|
|
32872
32882
|
/** What the apps race right now. */
|
|
32873
32883
|
resolved: array(string()).readonly(),
|
|
@@ -32887,10 +32897,10 @@ var HubAddressBookSchema = object({
|
|
|
32887
32897
|
eligible: array(HubAddressRoleSchema).readonly()
|
|
32888
32898
|
})).readonly(),
|
|
32889
32899
|
roles: object({
|
|
32890
|
-
|
|
32891
|
-
|
|
32892
|
-
|
|
32893
|
-
|
|
32900
|
+
appConnections: HubAppConnectionsResolutionSchema,
|
|
32901
|
+
notificationTaps: HubAddressRoleResolutionSchema,
|
|
32902
|
+
internal: HubAddressRoleResolutionSchema,
|
|
32903
|
+
publicEndpoint: HubAddressRoleResolutionSchema
|
|
32894
32904
|
}),
|
|
32895
32905
|
/** The `hub=` an app link carries (D709), or null. */
|
|
32896
32906
|
appLinkHub: string().nullable()
|
|
@@ -32938,7 +32948,7 @@ method(_void(), ListResultSchema), method(_void(), PreferredSchema), method(obje
|
|
|
32938
32948
|
* tunnel always emits `https://` regardless. */
|
|
32939
32949
|
scheme: _enum(["http", "https"]).optional(),
|
|
32940
32950
|
/** Append the CamStack app link entry (`kind: 'app-link'`, D709) —
|
|
32941
|
-
* an address notification
|
|
32951
|
+
* an address notification taps can be flagged with, not a hub
|
|
32942
32952
|
* route. Default `false`: racers and rankers never see it. */
|
|
32943
32953
|
includeAppLink: boolean().optional()
|
|
32944
32954
|
}), GetConnectionEndpointsResultSchema), method(_void(), NotificationEndpointSchema), method(object({ baseUrl: string().nullable() }), NotificationEndpointSchema, { kind: "mutation" }), method(_void(), ViewerEndpointsSchema), method(object({ baseUrls: array(string()).readonly() }), ViewerEndpointsSchema, { kind: "mutation" }), method(object({ scheme: _enum(["http", "https"]).optional() }).optional(), HubAddressBookSchema), method(object({
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
//#endregion
|
|
6
|
-
const require_dist = require("../dist-
|
|
6
|
+
const require_dist = require("../dist-WoiCiuhv.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
/** The `BrokerInfo.kind` tag the Home Assistant provider stamps. */
|
|
9
9
|
var HA_BROKER_KIND = "home-assistant";
|
|
@@ -4414,6 +4414,16 @@ function verifyExpiringUrl(input) {
|
|
|
4414
4414
|
* an expired link is refused whether or not its signature is valid, so a leaked
|
|
4415
4415
|
* URL stops working on its own.
|
|
4416
4416
|
*/
|
|
4417
|
+
/**
|
|
4418
|
+
* The base a media link is minted on when the operator left the addon's own
|
|
4419
|
+
* field empty: the hub's `internal` role (D734) — the address flagged
|
|
4420
|
+
* "Internal" on the Network page, else the detected LAN address. Home
|
|
4421
|
+
* Assistant is a LAN device pulling from the hub, so never the public
|
|
4422
|
+
* endpoint, and never loopback (`null` when nothing qualifies).
|
|
4423
|
+
*/
|
|
4424
|
+
function haMediaBaseUrl(book) {
|
|
4425
|
+
return book.roles.internal.resolved;
|
|
4426
|
+
}
|
|
4417
4427
|
/** How long a minted link stays valid. Long enough for HA to render it. */
|
|
4418
4428
|
var MEDIA_URL_TTL_MS = 360 * 60 * 1e3;
|
|
4419
4429
|
function signMedia(secret, id, expMs) {
|
|
@@ -7884,15 +7894,7 @@ var HaExportAddon = class extends require_dist.BaseAddon {
|
|
|
7884
7894
|
return;
|
|
7885
7895
|
}
|
|
7886
7896
|
try {
|
|
7887
|
-
|
|
7888
|
-
* Home Assistant is a LAN device pulling from the hub: the `agents`
|
|
7889
|
-
* role (the address flagged "Agents" on the Network page, else the
|
|
7890
|
-
* detected LAN address), never loopback — a link Home Assistant
|
|
7891
|
-
* cannot open is worse than no image, because it renders as a broken
|
|
7892
|
-
* entity rather than an empty one. Ranked by `local-network`, never here.
|
|
7893
|
-
*/
|
|
7894
|
-
const { roles } = await this.ctx.api.localNetwork.getAddresses.query();
|
|
7895
|
-
this.mediaBaseUrl = roles.agents.resolved;
|
|
7897
|
+
this.mediaBaseUrl = haMediaBaseUrl(await this.ctx.api.localNetwork.getAddresses.query());
|
|
7896
7898
|
} catch (err) {
|
|
7897
7899
|
this.mediaBaseUrl = null;
|
|
7898
7900
|
this.ctx.logger.debug("ha-export: could not resolve a media base URL", { meta: { error: errMsg(err) } });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as oauthIntegrationCapability, C as buildAddonRouteProvider, Ft as EventCategory, I as deviceExportCapability, St as nodePin, a as COCO_TO_MACRO, bt as BaseAddon, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, jt as string, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema } from "../dist-
|
|
1
|
+
import { $ as oauthIntegrationCapability, C as buildAddonRouteProvider, Ft as EventCategory, I as deviceExportCapability, St as nodePin, a as COCO_TO_MACRO, bt as BaseAddon, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, jt as string, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema } from "../dist-Cw91Z1Ew.mjs";
|
|
2
2
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
3
3
|
/** The `BrokerInfo.kind` tag the Home Assistant provider stamps. */
|
|
4
4
|
var HA_BROKER_KIND = "home-assistant";
|
|
@@ -4409,6 +4409,16 @@ function verifyExpiringUrl(input) {
|
|
|
4409
4409
|
* an expired link is refused whether or not its signature is valid, so a leaked
|
|
4410
4410
|
* URL stops working on its own.
|
|
4411
4411
|
*/
|
|
4412
|
+
/**
|
|
4413
|
+
* The base a media link is minted on when the operator left the addon's own
|
|
4414
|
+
* field empty: the hub's `internal` role (D734) — the address flagged
|
|
4415
|
+
* "Internal" on the Network page, else the detected LAN address. Home
|
|
4416
|
+
* Assistant is a LAN device pulling from the hub, so never the public
|
|
4417
|
+
* endpoint, and never loopback (`null` when nothing qualifies).
|
|
4418
|
+
*/
|
|
4419
|
+
function haMediaBaseUrl(book) {
|
|
4420
|
+
return book.roles.internal.resolved;
|
|
4421
|
+
}
|
|
4412
4422
|
/** How long a minted link stays valid. Long enough for HA to render it. */
|
|
4413
4423
|
var MEDIA_URL_TTL_MS = 360 * 60 * 1e3;
|
|
4414
4424
|
function signMedia(secret, id, expMs) {
|
|
@@ -7879,15 +7889,7 @@ var HaExportAddon = class extends BaseAddon {
|
|
|
7879
7889
|
return;
|
|
7880
7890
|
}
|
|
7881
7891
|
try {
|
|
7882
|
-
|
|
7883
|
-
* Home Assistant is a LAN device pulling from the hub: the `agents`
|
|
7884
|
-
* role (the address flagged "Agents" on the Network page, else the
|
|
7885
|
-
* detected LAN address), never loopback — a link Home Assistant
|
|
7886
|
-
* cannot open is worse than no image, because it renders as a broken
|
|
7887
|
-
* entity rather than an empty one. Ranked by `local-network`, never here.
|
|
7888
|
-
*/
|
|
7889
|
-
const { roles } = await this.ctx.api.localNetwork.getAddresses.query();
|
|
7890
|
-
this.mediaBaseUrl = roles.agents.resolved;
|
|
7892
|
+
this.mediaBaseUrl = haMediaBaseUrl(await this.ctx.api.localNetwork.getAddresses.query());
|
|
7891
7893
|
} catch (err) {
|
|
7892
7894
|
this.mediaBaseUrl = null;
|
|
7893
7895
|
this.ctx.logger.debug("ha-export: could not resolve a media base URL", { meta: { error: errMsg(err) } });
|