@camstack/addon-provider-enpal 0.1.21 → 0.1.22
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 +6 -0
- package/dist/addon.js +115 -15
- package/dist/addon.mjs +115 -15
- package/package.json +2 -2
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
|
+
## [0.1.22] - 2026-11-14
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- A house or heat-pump meter still named Consumption is renamed to the current catalogue name on restore; a name you chose is left as it is.
|
|
15
|
+
|
|
10
16
|
## [0.1.21] - 2026-11-14
|
|
11
17
|
|
|
12
18
|
### Changed
|
package/dist/addon.js
CHANGED
|
@@ -815,7 +815,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
815
815
|
return EventCategory;
|
|
816
816
|
}({});
|
|
817
817
|
//#endregion
|
|
818
|
-
//#region ../types/dist/composed-stable-id-
|
|
818
|
+
//#region ../types/dist/composed-stable-id-COP6zOXx.mjs
|
|
819
819
|
/**
|
|
820
820
|
import { errMsg } from '@camstack/types'
|
|
821
821
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -828,8 +828,6 @@ function errMsg(err) {
|
|
|
828
828
|
}
|
|
829
829
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
830
830
|
DeviceType["Camera"] = "camera";
|
|
831
|
-
/** Legacy stored value, read only by the hub-to-integration migrations; no live device carries it. */
|
|
832
|
-
DeviceType["Hub"] = "hub";
|
|
833
831
|
DeviceType["Light"] = "light";
|
|
834
832
|
DeviceType["Siren"] = "siren";
|
|
835
833
|
DeviceType["Switch"] = "switch";
|
|
@@ -6066,7 +6064,7 @@ var ZodIssueCode = {
|
|
|
6066
6064
|
var ZodFirstPartyTypeKind;
|
|
6067
6065
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6068
6066
|
//#endregion
|
|
6069
|
-
//#region ../types/dist/sleep-
|
|
6067
|
+
//#region ../types/dist/sleep-B5XPl2YP.mjs
|
|
6070
6068
|
/**
|
|
6071
6069
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6072
6070
|
* window to float samples (D455).
|
|
@@ -6729,7 +6727,8 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
|
|
|
6729
6727
|
try {
|
|
6730
6728
|
declaration = await host.declareOwner({
|
|
6731
6729
|
owner,
|
|
6732
|
-
metas: migrations.map((m) => m.meta)
|
|
6730
|
+
metas: migrations.map((m) => m.meta),
|
|
6731
|
+
...options.retired === void 0 ? {} : { retired: [...options.retired] }
|
|
6733
6732
|
});
|
|
6734
6733
|
} catch (err) {
|
|
6735
6734
|
log.error("the migration engine refused or could not take this addon catalogue — none ran", { meta: { error: errMsg(err) } });
|
|
@@ -8722,6 +8721,14 @@ var BaseAddon = class {
|
|
|
8722
8721
|
declareRegistrySwitch(spec) {
|
|
8723
8722
|
this.registrySwitchSpec = spec;
|
|
8724
8723
|
}
|
|
8724
|
+
/**
|
|
8725
|
+
* Ids this addon removed from its catalogue on purpose (`declareRetiredMigrations`): sent with
|
|
8726
|
+
* every declaration so the engine does not read their applied rows as a newer database.
|
|
8727
|
+
*/
|
|
8728
|
+
retiredMigrationIds = [];
|
|
8729
|
+
declareRetiredMigrations(ids) {
|
|
8730
|
+
this.retiredMigrationIds = ids;
|
|
8731
|
+
}
|
|
8725
8732
|
registrySwitchSpec = null;
|
|
8726
8733
|
registrySwitchBound() {
|
|
8727
8734
|
const spec = this.registrySwitchSpec;
|
|
@@ -8745,10 +8752,14 @@ var BaseAddon = class {
|
|
|
8745
8752
|
async runBound(declared, options) {
|
|
8746
8753
|
const added = this.registrySwitchBound();
|
|
8747
8754
|
const migrations = [...declared, ...added];
|
|
8748
|
-
const
|
|
8755
|
+
const widened = options?.only === void 0 || added.length === 0 ? options : {
|
|
8749
8756
|
...options,
|
|
8750
8757
|
only: [...options.only, ...added.map((m) => m.meta.id)]
|
|
8751
8758
|
};
|
|
8759
|
+
const phased = this.retiredMigrationIds.length === 0 ? widened ?? {} : {
|
|
8760
|
+
...widened,
|
|
8761
|
+
retired: this.retiredMigrationIds
|
|
8762
|
+
};
|
|
8752
8763
|
const api = this.ctx.api.migrations;
|
|
8753
8764
|
const report = await runAddonMigrations({
|
|
8754
8765
|
declareOwner: (input) => api.declareOwner.mutate(input),
|
|
@@ -21683,7 +21694,7 @@ Object.freeze({
|
|
|
21683
21694
|
}
|
|
21684
21695
|
});
|
|
21685
21696
|
//#endregion
|
|
21686
|
-
//#region ../types/dist/implemented-methods-
|
|
21697
|
+
//#region ../types/dist/implemented-methods-0xxMOekw.mjs
|
|
21687
21698
|
/**
|
|
21688
21699
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
21689
21700
|
*
|
|
@@ -57553,7 +57564,7 @@ var mediaPlayerCapability = {
|
|
|
57553
57564
|
]
|
|
57554
57565
|
}
|
|
57555
57566
|
};
|
|
57556
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.
|
|
57567
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, 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.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.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.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer;
|
|
57557
57568
|
var NUMBER$1 = {
|
|
57558
57569
|
kind: "fixed",
|
|
57559
57570
|
result: ["number"]
|
|
@@ -61880,7 +61891,7 @@ var TransitionsStatusSchema = object({
|
|
|
61880
61891
|
/** Refused rows since start, by reason. */
|
|
61881
61892
|
refused: record(string(), number$1())
|
|
61882
61893
|
});
|
|
61883
|
-
Object.values(DeviceType).filter((type) => type !== DeviceType.
|
|
61894
|
+
Object.values(DeviceType).filter((type) => type !== DeviceType.Container), method(object({
|
|
61884
61895
|
deviceId: number$1().int(),
|
|
61885
61896
|
capName: string().optional(),
|
|
61886
61897
|
actorKind: TransitionActorKindSchema.optional(),
|
|
@@ -65827,7 +65838,7 @@ var HeroSceneSchema = object({
|
|
|
65827
65838
|
/** 0..1: volume, cover position, cycle progress. */
|
|
65828
65839
|
level: number$1().min(0).max(1).nullable()
|
|
65829
65840
|
});
|
|
65830
|
-
DeviceType.Camera, DeviceType.
|
|
65841
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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;
|
|
65831
65842
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
65832
65843
|
var HeroRowIdSchema = _enum([
|
|
65833
65844
|
"progress",
|
|
@@ -70583,7 +70594,9 @@ method(object({}), object({ entries: array(MigrationLedgerEntrySchema) }), { aut
|
|
|
70583
70594
|
auth: "admin"
|
|
70584
70595
|
}), method(object({
|
|
70585
70596
|
owner: string().min(1),
|
|
70586
|
-
metas: array(MigrationMetaSchema)
|
|
70597
|
+
metas: array(MigrationMetaSchema),
|
|
70598
|
+
/** Ids the owner deliberately removed: an applied row of one is fine, never "newer". */
|
|
70599
|
+
retired: array(string().min(1)).optional()
|
|
70587
70600
|
}), object({
|
|
70588
70601
|
bootId: string(),
|
|
70589
70602
|
snapshot: _enum([
|
|
@@ -95030,7 +95043,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
95030
95043
|
}
|
|
95031
95044
|
};
|
|
95032
95045
|
DeviceType.HeatPump;
|
|
95033
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.
|
|
95046
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, 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;
|
|
95034
95047
|
new Set(Object.values(DeviceType));
|
|
95035
95048
|
/** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
|
|
95036
95049
|
function contribution(cap, schema, build) {
|
|
@@ -97075,7 +97088,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
|
|
|
97075
97088
|
...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
|
|
97076
97089
|
...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
|
|
97077
97090
|
];
|
|
97078
|
-
DeviceType.Camera, DeviceType.
|
|
97091
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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;
|
|
97079
97092
|
/**
|
|
97080
97093
|
* Who looks like what (D1023). One look per {@link DeviceType}, refined by a
|
|
97081
97094
|
* {@link DeviceRole} where the role changes how the device reads (a leak
|
|
@@ -97719,7 +97732,7 @@ lookOf({
|
|
|
97719
97732
|
standby: MUTED
|
|
97720
97733
|
});
|
|
97721
97734
|
DeviceType.Climate;
|
|
97722
|
-
DeviceType.Camera, DeviceType.
|
|
97735
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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;
|
|
97723
97736
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
97724
97737
|
Object.freeze({
|
|
97725
97738
|
"accessories.getStatus": {
|
|
@@ -108190,7 +108203,7 @@ function offered(received) {
|
|
|
108190
108203
|
};
|
|
108191
108204
|
}
|
|
108192
108205
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
108193
|
-
DeviceType.Camera, DeviceType.
|
|
108206
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, 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;
|
|
108194
108207
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
108195
108208
|
new Set(Object.values(DeviceType));
|
|
108196
108209
|
new Set(Object.values(DeviceRole));
|
|
@@ -114218,6 +114231,53 @@ function accessoryChildSpecs(config) {
|
|
|
114218
114231
|
return out;
|
|
114219
114232
|
}
|
|
114220
114233
|
//#endregion
|
|
114234
|
+
//#region src/devices/enpal-catalog-rename.ts
|
|
114235
|
+
/**
|
|
114236
|
+
* House and heat-pump meters used to be created as "Consumption". A restore
|
|
114237
|
+
* may replace that default; a name the operator chose stays.
|
|
114238
|
+
*/
|
|
114239
|
+
/** Keep unless the stored name is still the old catalogue default for this meter. */
|
|
114240
|
+
function catalogNameWrite(input) {
|
|
114241
|
+
const spec = findSpec(input.specId);
|
|
114242
|
+
if (spec === void 0) return { kind: "keep" };
|
|
114243
|
+
if (input.specId !== "house" && input.specId !== "heatpump") return { kind: "keep" };
|
|
114244
|
+
if (input.name === spec.name) return { kind: "keep" };
|
|
114245
|
+
if (input.name !== "Consumption") return { kind: "keep" };
|
|
114246
|
+
return {
|
|
114247
|
+
kind: "rename",
|
|
114248
|
+
name: spec.name,
|
|
114249
|
+
stampUserNamed: input.userNamed === true
|
|
114250
|
+
};
|
|
114251
|
+
}
|
|
114252
|
+
/** Rename each child that still carries the old default. Logs every rename. */
|
|
114253
|
+
async function renameLegacyCatalogDevices(input) {
|
|
114254
|
+
for (const child of input.children) {
|
|
114255
|
+
const decision = catalogNameWrite(child);
|
|
114256
|
+
if (decision.kind === "keep") continue;
|
|
114257
|
+
try {
|
|
114258
|
+
await input.rename(child.deviceId, decision.name, decision.stampUserNamed);
|
|
114259
|
+
} catch (err) {
|
|
114260
|
+
input.logger.warn("enpal: could not rename a device still carrying the old catalogue name", {
|
|
114261
|
+
tags: { deviceId: child.deviceId },
|
|
114262
|
+
meta: {
|
|
114263
|
+
from: child.name,
|
|
114264
|
+
to: decision.name,
|
|
114265
|
+
error: errMsg(err)
|
|
114266
|
+
}
|
|
114267
|
+
});
|
|
114268
|
+
continue;
|
|
114269
|
+
}
|
|
114270
|
+
input.logger.info("enpal: renamed a device that still had the old catalogue name", {
|
|
114271
|
+
tags: { deviceId: child.deviceId },
|
|
114272
|
+
meta: {
|
|
114273
|
+
specId: child.specId,
|
|
114274
|
+
from: child.name,
|
|
114275
|
+
to: decision.name
|
|
114276
|
+
}
|
|
114277
|
+
});
|
|
114278
|
+
}
|
|
114279
|
+
}
|
|
114280
|
+
//#endregion
|
|
114221
114281
|
//#region src/devices/enpal-metadata-sync.ts
|
|
114222
114282
|
/**
|
|
114223
114283
|
* Writes the identity facts a piece reported (model, serial, firmware) as device attributes.
|
|
@@ -114333,6 +114393,7 @@ var EnpalEquipmentDevice = class extends BaseDevice {
|
|
|
114333
114393
|
},
|
|
114334
114394
|
logger: this.ctx.logger
|
|
114335
114395
|
});
|
|
114396
|
+
await this.renameLegacyNames();
|
|
114336
114397
|
const metadata = new EnpalMetadataSync({
|
|
114337
114398
|
equipment: this.equipment,
|
|
114338
114399
|
deviceId: this.id,
|
|
@@ -114350,6 +114411,45 @@ var EnpalEquipmentDevice = class extends BaseDevice {
|
|
|
114350
114411
|
});
|
|
114351
114412
|
await metadata.apply();
|
|
114352
114413
|
}
|
|
114414
|
+
/**
|
|
114415
|
+
* A meter created as "Consumption" takes the current catalogue name. A name
|
|
114416
|
+
* the operator changed is left as it is.
|
|
114417
|
+
*/
|
|
114418
|
+
async renameLegacyNames() {
|
|
114419
|
+
const manager = this.ctx.api.deviceManager;
|
|
114420
|
+
try {
|
|
114421
|
+
const legacy = (await manager.getChildren.query({ parentDeviceId: this.id })).flatMap((child) => {
|
|
114422
|
+
const specId = child.config["specId"];
|
|
114423
|
+
if (typeof specId !== "string" || child.name !== "Consumption") return [];
|
|
114424
|
+
return [{
|
|
114425
|
+
deviceId: child.id,
|
|
114426
|
+
specId,
|
|
114427
|
+
name: child.name
|
|
114428
|
+
}];
|
|
114429
|
+
});
|
|
114430
|
+
await renameLegacyCatalogDevices({
|
|
114431
|
+
children: await Promise.all(legacy.map(async (child) => {
|
|
114432
|
+
const meta = await manager.loadMeta.query({ deviceId: child.deviceId });
|
|
114433
|
+
return {
|
|
114434
|
+
...child,
|
|
114435
|
+
name: meta?.name ?? child.name,
|
|
114436
|
+
userNamed: meta?.userNamed
|
|
114437
|
+
};
|
|
114438
|
+
})),
|
|
114439
|
+
rename: (deviceId, name, stampUserNamed) => manager.setName.mutate({
|
|
114440
|
+
deviceId,
|
|
114441
|
+
name,
|
|
114442
|
+
...stampUserNamed ? {} : { stampUserNamed: false }
|
|
114443
|
+
}),
|
|
114444
|
+
logger: this.ctx.logger
|
|
114445
|
+
});
|
|
114446
|
+
} catch (err) {
|
|
114447
|
+
this.ctx.logger.warn("enpal: could not rename devices still carrying the old catalogue name", {
|
|
114448
|
+
tags: { deviceId: this.id },
|
|
114449
|
+
meta: { error: errMsg(err) }
|
|
114450
|
+
});
|
|
114451
|
+
}
|
|
114452
|
+
}
|
|
114353
114453
|
async removeDevice() {
|
|
114354
114454
|
this.snapshotUnsub?.();
|
|
114355
114455
|
this.snapshotUnsub = null;
|
package/dist/addon.mjs
CHANGED
|
@@ -814,7 +814,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
814
814
|
return EventCategory;
|
|
815
815
|
}({});
|
|
816
816
|
//#endregion
|
|
817
|
-
//#region ../types/dist/composed-stable-id-
|
|
817
|
+
//#region ../types/dist/composed-stable-id-COP6zOXx.mjs
|
|
818
818
|
/**
|
|
819
819
|
import { errMsg } from '@camstack/types'
|
|
820
820
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -827,8 +827,6 @@ function errMsg(err) {
|
|
|
827
827
|
}
|
|
828
828
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
829
829
|
DeviceType["Camera"] = "camera";
|
|
830
|
-
/** Legacy stored value, read only by the hub-to-integration migrations; no live device carries it. */
|
|
831
|
-
DeviceType["Hub"] = "hub";
|
|
832
830
|
DeviceType["Light"] = "light";
|
|
833
831
|
DeviceType["Siren"] = "siren";
|
|
834
832
|
DeviceType["Switch"] = "switch";
|
|
@@ -6065,7 +6063,7 @@ var ZodIssueCode = {
|
|
|
6065
6063
|
var ZodFirstPartyTypeKind;
|
|
6066
6064
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6067
6065
|
//#endregion
|
|
6068
|
-
//#region ../types/dist/sleep-
|
|
6066
|
+
//#region ../types/dist/sleep-B5XPl2YP.mjs
|
|
6069
6067
|
/**
|
|
6070
6068
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6071
6069
|
* window to float samples (D455).
|
|
@@ -6728,7 +6726,8 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
|
|
|
6728
6726
|
try {
|
|
6729
6727
|
declaration = await host.declareOwner({
|
|
6730
6728
|
owner,
|
|
6731
|
-
metas: migrations.map((m) => m.meta)
|
|
6729
|
+
metas: migrations.map((m) => m.meta),
|
|
6730
|
+
...options.retired === void 0 ? {} : { retired: [...options.retired] }
|
|
6732
6731
|
});
|
|
6733
6732
|
} catch (err) {
|
|
6734
6733
|
log.error("the migration engine refused or could not take this addon catalogue — none ran", { meta: { error: errMsg(err) } });
|
|
@@ -8721,6 +8720,14 @@ var BaseAddon = class {
|
|
|
8721
8720
|
declareRegistrySwitch(spec) {
|
|
8722
8721
|
this.registrySwitchSpec = spec;
|
|
8723
8722
|
}
|
|
8723
|
+
/**
|
|
8724
|
+
* Ids this addon removed from its catalogue on purpose (`declareRetiredMigrations`): sent with
|
|
8725
|
+
* every declaration so the engine does not read their applied rows as a newer database.
|
|
8726
|
+
*/
|
|
8727
|
+
retiredMigrationIds = [];
|
|
8728
|
+
declareRetiredMigrations(ids) {
|
|
8729
|
+
this.retiredMigrationIds = ids;
|
|
8730
|
+
}
|
|
8724
8731
|
registrySwitchSpec = null;
|
|
8725
8732
|
registrySwitchBound() {
|
|
8726
8733
|
const spec = this.registrySwitchSpec;
|
|
@@ -8744,10 +8751,14 @@ var BaseAddon = class {
|
|
|
8744
8751
|
async runBound(declared, options) {
|
|
8745
8752
|
const added = this.registrySwitchBound();
|
|
8746
8753
|
const migrations = [...declared, ...added];
|
|
8747
|
-
const
|
|
8754
|
+
const widened = options?.only === void 0 || added.length === 0 ? options : {
|
|
8748
8755
|
...options,
|
|
8749
8756
|
only: [...options.only, ...added.map((m) => m.meta.id)]
|
|
8750
8757
|
};
|
|
8758
|
+
const phased = this.retiredMigrationIds.length === 0 ? widened ?? {} : {
|
|
8759
|
+
...widened,
|
|
8760
|
+
retired: this.retiredMigrationIds
|
|
8761
|
+
};
|
|
8751
8762
|
const api = this.ctx.api.migrations;
|
|
8752
8763
|
const report = await runAddonMigrations({
|
|
8753
8764
|
declareOwner: (input) => api.declareOwner.mutate(input),
|
|
@@ -21682,7 +21693,7 @@ Object.freeze({
|
|
|
21682
21693
|
}
|
|
21683
21694
|
});
|
|
21684
21695
|
//#endregion
|
|
21685
|
-
//#region ../types/dist/implemented-methods-
|
|
21696
|
+
//#region ../types/dist/implemented-methods-0xxMOekw.mjs
|
|
21686
21697
|
/**
|
|
21687
21698
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
21688
21699
|
*
|
|
@@ -57552,7 +57563,7 @@ var mediaPlayerCapability = {
|
|
|
57552
57563
|
]
|
|
57553
57564
|
}
|
|
57554
57565
|
};
|
|
57555
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.
|
|
57566
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, 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.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.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.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer;
|
|
57556
57567
|
var NUMBER$1 = {
|
|
57557
57568
|
kind: "fixed",
|
|
57558
57569
|
result: ["number"]
|
|
@@ -61879,7 +61890,7 @@ var TransitionsStatusSchema = object({
|
|
|
61879
61890
|
/** Refused rows since start, by reason. */
|
|
61880
61891
|
refused: record(string(), number$1())
|
|
61881
61892
|
});
|
|
61882
|
-
Object.values(DeviceType).filter((type) => type !== DeviceType.
|
|
61893
|
+
Object.values(DeviceType).filter((type) => type !== DeviceType.Container), method(object({
|
|
61883
61894
|
deviceId: number$1().int(),
|
|
61884
61895
|
capName: string().optional(),
|
|
61885
61896
|
actorKind: TransitionActorKindSchema.optional(),
|
|
@@ -65826,7 +65837,7 @@ var HeroSceneSchema = object({
|
|
|
65826
65837
|
/** 0..1: volume, cover position, cycle progress. */
|
|
65827
65838
|
level: number$1().min(0).max(1).nullable()
|
|
65828
65839
|
});
|
|
65829
|
-
DeviceType.Camera, DeviceType.
|
|
65840
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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;
|
|
65830
65841
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
65831
65842
|
var HeroRowIdSchema = _enum([
|
|
65832
65843
|
"progress",
|
|
@@ -70582,7 +70593,9 @@ method(object({}), object({ entries: array(MigrationLedgerEntrySchema) }), { aut
|
|
|
70582
70593
|
auth: "admin"
|
|
70583
70594
|
}), method(object({
|
|
70584
70595
|
owner: string().min(1),
|
|
70585
|
-
metas: array(MigrationMetaSchema)
|
|
70596
|
+
metas: array(MigrationMetaSchema),
|
|
70597
|
+
/** Ids the owner deliberately removed: an applied row of one is fine, never "newer". */
|
|
70598
|
+
retired: array(string().min(1)).optional()
|
|
70586
70599
|
}), object({
|
|
70587
70600
|
bootId: string(),
|
|
70588
70601
|
snapshot: _enum([
|
|
@@ -95029,7 +95042,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
95029
95042
|
}
|
|
95030
95043
|
};
|
|
95031
95044
|
DeviceType.HeatPump;
|
|
95032
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.
|
|
95045
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, 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;
|
|
95033
95046
|
new Set(Object.values(DeviceType));
|
|
95034
95047
|
/** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
|
|
95035
95048
|
function contribution(cap, schema, build) {
|
|
@@ -97074,7 +97087,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
|
|
|
97074
97087
|
...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
|
|
97075
97088
|
...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
|
|
97076
97089
|
];
|
|
97077
|
-
DeviceType.Camera, DeviceType.
|
|
97090
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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;
|
|
97078
97091
|
/**
|
|
97079
97092
|
* Who looks like what (D1023). One look per {@link DeviceType}, refined by a
|
|
97080
97093
|
* {@link DeviceRole} where the role changes how the device reads (a leak
|
|
@@ -97718,7 +97731,7 @@ lookOf({
|
|
|
97718
97731
|
standby: MUTED
|
|
97719
97732
|
});
|
|
97720
97733
|
DeviceType.Climate;
|
|
97721
|
-
DeviceType.Camera, DeviceType.
|
|
97734
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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;
|
|
97722
97735
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
97723
97736
|
Object.freeze({
|
|
97724
97737
|
"accessories.getStatus": {
|
|
@@ -108189,7 +108202,7 @@ function offered(received) {
|
|
|
108189
108202
|
};
|
|
108190
108203
|
}
|
|
108191
108204
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
108192
|
-
DeviceType.Camera, DeviceType.
|
|
108205
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, 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;
|
|
108193
108206
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
108194
108207
|
new Set(Object.values(DeviceType));
|
|
108195
108208
|
new Set(Object.values(DeviceRole));
|
|
@@ -114217,6 +114230,53 @@ function accessoryChildSpecs(config) {
|
|
|
114217
114230
|
return out;
|
|
114218
114231
|
}
|
|
114219
114232
|
//#endregion
|
|
114233
|
+
//#region src/devices/enpal-catalog-rename.ts
|
|
114234
|
+
/**
|
|
114235
|
+
* House and heat-pump meters used to be created as "Consumption". A restore
|
|
114236
|
+
* may replace that default; a name the operator chose stays.
|
|
114237
|
+
*/
|
|
114238
|
+
/** Keep unless the stored name is still the old catalogue default for this meter. */
|
|
114239
|
+
function catalogNameWrite(input) {
|
|
114240
|
+
const spec = findSpec(input.specId);
|
|
114241
|
+
if (spec === void 0) return { kind: "keep" };
|
|
114242
|
+
if (input.specId !== "house" && input.specId !== "heatpump") return { kind: "keep" };
|
|
114243
|
+
if (input.name === spec.name) return { kind: "keep" };
|
|
114244
|
+
if (input.name !== "Consumption") return { kind: "keep" };
|
|
114245
|
+
return {
|
|
114246
|
+
kind: "rename",
|
|
114247
|
+
name: spec.name,
|
|
114248
|
+
stampUserNamed: input.userNamed === true
|
|
114249
|
+
};
|
|
114250
|
+
}
|
|
114251
|
+
/** Rename each child that still carries the old default. Logs every rename. */
|
|
114252
|
+
async function renameLegacyCatalogDevices(input) {
|
|
114253
|
+
for (const child of input.children) {
|
|
114254
|
+
const decision = catalogNameWrite(child);
|
|
114255
|
+
if (decision.kind === "keep") continue;
|
|
114256
|
+
try {
|
|
114257
|
+
await input.rename(child.deviceId, decision.name, decision.stampUserNamed);
|
|
114258
|
+
} catch (err) {
|
|
114259
|
+
input.logger.warn("enpal: could not rename a device still carrying the old catalogue name", {
|
|
114260
|
+
tags: { deviceId: child.deviceId },
|
|
114261
|
+
meta: {
|
|
114262
|
+
from: child.name,
|
|
114263
|
+
to: decision.name,
|
|
114264
|
+
error: errMsg(err)
|
|
114265
|
+
}
|
|
114266
|
+
});
|
|
114267
|
+
continue;
|
|
114268
|
+
}
|
|
114269
|
+
input.logger.info("enpal: renamed a device that still had the old catalogue name", {
|
|
114270
|
+
tags: { deviceId: child.deviceId },
|
|
114271
|
+
meta: {
|
|
114272
|
+
specId: child.specId,
|
|
114273
|
+
from: child.name,
|
|
114274
|
+
to: decision.name
|
|
114275
|
+
}
|
|
114276
|
+
});
|
|
114277
|
+
}
|
|
114278
|
+
}
|
|
114279
|
+
//#endregion
|
|
114220
114280
|
//#region src/devices/enpal-metadata-sync.ts
|
|
114221
114281
|
/**
|
|
114222
114282
|
* Writes the identity facts a piece reported (model, serial, firmware) as device attributes.
|
|
@@ -114332,6 +114392,7 @@ var EnpalEquipmentDevice = class extends BaseDevice {
|
|
|
114332
114392
|
},
|
|
114333
114393
|
logger: this.ctx.logger
|
|
114334
114394
|
});
|
|
114395
|
+
await this.renameLegacyNames();
|
|
114335
114396
|
const metadata = new EnpalMetadataSync({
|
|
114336
114397
|
equipment: this.equipment,
|
|
114337
114398
|
deviceId: this.id,
|
|
@@ -114349,6 +114410,45 @@ var EnpalEquipmentDevice = class extends BaseDevice {
|
|
|
114349
114410
|
});
|
|
114350
114411
|
await metadata.apply();
|
|
114351
114412
|
}
|
|
114413
|
+
/**
|
|
114414
|
+
* A meter created as "Consumption" takes the current catalogue name. A name
|
|
114415
|
+
* the operator changed is left as it is.
|
|
114416
|
+
*/
|
|
114417
|
+
async renameLegacyNames() {
|
|
114418
|
+
const manager = this.ctx.api.deviceManager;
|
|
114419
|
+
try {
|
|
114420
|
+
const legacy = (await manager.getChildren.query({ parentDeviceId: this.id })).flatMap((child) => {
|
|
114421
|
+
const specId = child.config["specId"];
|
|
114422
|
+
if (typeof specId !== "string" || child.name !== "Consumption") return [];
|
|
114423
|
+
return [{
|
|
114424
|
+
deviceId: child.id,
|
|
114425
|
+
specId,
|
|
114426
|
+
name: child.name
|
|
114427
|
+
}];
|
|
114428
|
+
});
|
|
114429
|
+
await renameLegacyCatalogDevices({
|
|
114430
|
+
children: await Promise.all(legacy.map(async (child) => {
|
|
114431
|
+
const meta = await manager.loadMeta.query({ deviceId: child.deviceId });
|
|
114432
|
+
return {
|
|
114433
|
+
...child,
|
|
114434
|
+
name: meta?.name ?? child.name,
|
|
114435
|
+
userNamed: meta?.userNamed
|
|
114436
|
+
};
|
|
114437
|
+
})),
|
|
114438
|
+
rename: (deviceId, name, stampUserNamed) => manager.setName.mutate({
|
|
114439
|
+
deviceId,
|
|
114440
|
+
name,
|
|
114441
|
+
...stampUserNamed ? {} : { stampUserNamed: false }
|
|
114442
|
+
}),
|
|
114443
|
+
logger: this.ctx.logger
|
|
114444
|
+
});
|
|
114445
|
+
} catch (err) {
|
|
114446
|
+
this.ctx.logger.warn("enpal: could not rename devices still carrying the old catalogue name", {
|
|
114447
|
+
tags: { deviceId: this.id },
|
|
114448
|
+
meta: { error: errMsg(err) }
|
|
114449
|
+
});
|
|
114450
|
+
}
|
|
114451
|
+
}
|
|
114352
114452
|
async removeDevice() {
|
|
114353
114453
|
this.snapshotUnsub?.();
|
|
114354
114454
|
this.snapshotUnsub = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-enpal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Enpal solar-box device-provider addon for CamStack — PV, battery, grid, house and heat-pump readings from the box's own web-page channel, its local InfluxDB or its device page",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
],
|
|
68
68
|
"requires": {
|
|
69
|
-
"server": ">=1.2.
|
|
69
|
+
"server": ">=1.2.865"
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
72
|
"files": [
|