@riddix/hamh 2.1.0-alpha.552 → 2.1.0-alpha.554
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/backend/cli.js
CHANGED
|
@@ -152869,6 +152869,8 @@ var EntityMappingStorage = class extends Service {
|
|
|
152869
152869
|
entityId: request.entityId,
|
|
152870
152870
|
matterDeviceType: request.matterDeviceType,
|
|
152871
152871
|
customName: request.customName?.trim() || void 0,
|
|
152872
|
+
customProductName: request.customProductName?.trim() || void 0,
|
|
152873
|
+
customVendorName: request.customVendorName?.trim() || void 0,
|
|
152872
152874
|
disabled: request.disabled,
|
|
152873
152875
|
filterLifeEntity: request.filterLifeEntity?.trim() || void 0,
|
|
152874
152876
|
cleaningModeEntity: request.cleaningModeEntity?.trim() || void 0,
|
|
@@ -152891,7 +152893,7 @@ var EntityMappingStorage = class extends Service {
|
|
|
152891
152893
|
coverSwapOpenClose: request.coverSwapOpenClose || void 0,
|
|
152892
152894
|
composedEntities: request.composedEntities?.filter((e) => e.entityId?.trim()) ?? void 0
|
|
152893
152895
|
};
|
|
152894
|
-
if (!config10.matterDeviceType && !config10.customName && config10.disabled !== true && !config10.filterLifeEntity && !config10.cleaningModeEntity && !config10.temperatureEntity && !config10.humidityEntity && !config10.batteryEntity && !config10.roomEntities && !config10.disableLockPin && !config10.powerEntity && !config10.energyEntity && !config10.pressureEntity && !config10.suctionLevelEntity && !config10.mopIntensityEntity && (!config10.customServiceAreas || config10.customServiceAreas.length === 0) && (!config10.customFanSpeedTags || Object.keys(config10.customFanSpeedTags).length === 0) && !config10.currentRoomEntity && !config10.valetudoIdentifier && !config10.coverSwapOpenClose && (!config10.composedEntities || config10.composedEntities.length === 0)) {
|
|
152896
|
+
if (!config10.matterDeviceType && !config10.customName && !config10.customProductName && !config10.customVendorName && config10.disabled !== true && !config10.filterLifeEntity && !config10.cleaningModeEntity && !config10.temperatureEntity && !config10.humidityEntity && !config10.batteryEntity && !config10.roomEntities && !config10.disableLockPin && !config10.powerEntity && !config10.energyEntity && !config10.pressureEntity && !config10.suctionLevelEntity && !config10.mopIntensityEntity && (!config10.customServiceAreas || config10.customServiceAreas.length === 0) && (!config10.customFanSpeedTags || Object.keys(config10.customFanSpeedTags).length === 0) && !config10.currentRoomEntity && !config10.valetudoIdentifier && !config10.coverSwapOpenClose && (!config10.composedEntities || config10.composedEntities.length === 0)) {
|
|
152895
152897
|
bridgeMap.delete(request.entityId);
|
|
152896
152898
|
} else {
|
|
152897
152899
|
bridgeMap.set(request.entityId, config10);
|
|
@@ -167787,10 +167789,11 @@ var BasicInformationServer2 = class extends BridgedDeviceBasicInformationServer
|
|
|
167787
167789
|
const { basicInformation } = this.env.get(BridgeDataProvider);
|
|
167788
167790
|
const homeAssistant = this.agent.get(HomeAssistantEntityBehavior);
|
|
167789
167791
|
const device = entity.deviceRegistry;
|
|
167792
|
+
const mapping = homeAssistant.state.mapping;
|
|
167790
167793
|
applyPatchState(this.state, {
|
|
167791
167794
|
vendorId: VendorId(basicInformation.vendorId),
|
|
167792
|
-
vendorName: ellipse(32, device?.manufacturer) ?? hash(32, basicInformation.vendorName),
|
|
167793
|
-
productName: ellipse(32, device?.model_id) ?? ellipse(32, device?.model) ?? hash(32, basicInformation.productName),
|
|
167795
|
+
vendorName: ellipse(32, mapping?.customVendorName) ?? ellipse(32, device?.manufacturer) ?? hash(32, basicInformation.vendorName),
|
|
167796
|
+
productName: ellipse(32, mapping?.customProductName) ?? ellipse(32, device?.model_id) ?? ellipse(32, device?.model) ?? hash(32, basicInformation.productName),
|
|
167794
167797
|
productLabel: ellipse(64, device?.model) ?? hash(64, basicInformation.productLabel),
|
|
167795
167798
|
hardwareVersion: basicInformation.hardwareVersion,
|
|
167796
167799
|
softwareVersion: basicInformation.softwareVersion,
|
|
@@ -175692,6 +175695,11 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175692
175695
|
completedAreas = /* @__PURE__ */ new Set();
|
|
175693
175696
|
/** Last known currentArea — used to detect room transitions */
|
|
175694
175697
|
lastCurrentArea = null;
|
|
175698
|
+
/** Snapshot of selectedAreas taken when cleaning starts.
|
|
175699
|
+
* The start handler clears serviceArea.state.selectedAreas after
|
|
175700
|
+
* dispatching the HA action to prevent re-dispatch, but progress
|
|
175701
|
+
* tracking needs the original list for the entire cleaning session. */
|
|
175702
|
+
activeAreas = [];
|
|
175695
175703
|
async initialize() {
|
|
175696
175704
|
await super.initialize();
|
|
175697
175705
|
const homeAssistant = await this.agent.load(HomeAssistantEntityBehavior);
|
|
@@ -175713,16 +175721,13 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175713
175721
|
});
|
|
175714
175722
|
if (previousMode !== newMode) {
|
|
175715
175723
|
if (newMode === 0 /* Idle */) {
|
|
175724
|
+
this.trySetCurrentArea(null);
|
|
175716
175725
|
this.completedAreas.clear();
|
|
175717
175726
|
this.lastCurrentArea = null;
|
|
175718
|
-
this.
|
|
175727
|
+
this.activeAreas = [];
|
|
175719
175728
|
} else if (newMode === 1 /* Cleaning */) {
|
|
175720
|
-
|
|
175721
|
-
|
|
175722
|
-
if (serviceArea.state.selectedAreas?.length > 0 && serviceArea.state.currentArea === null) {
|
|
175723
|
-
this.trySetCurrentArea(serviceArea.state.selectedAreas[0]);
|
|
175724
|
-
}
|
|
175725
|
-
} catch {
|
|
175729
|
+
if (this.activeAreas.length > 0 && this.lastCurrentArea === null) {
|
|
175730
|
+
this.trySetCurrentArea(this.activeAreas[0]);
|
|
175726
175731
|
}
|
|
175727
175732
|
}
|
|
175728
175733
|
}
|
|
@@ -175742,14 +175747,13 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175742
175747
|
const stateProvider = this.agent.env.get(EntityStateProvider);
|
|
175743
175748
|
const roomState = stateProvider.getState(currentRoomEntityId);
|
|
175744
175749
|
if (!roomState || !roomState.state) return;
|
|
175750
|
+
if (this.activeAreas.length === 0) return;
|
|
175745
175751
|
const serviceArea = this.agent.get(ServiceAreaBehavior);
|
|
175746
|
-
const selectedAreas = serviceArea.state.selectedAreas;
|
|
175747
|
-
if (!selectedAreas || selectedAreas.length === 0) return;
|
|
175748
175752
|
const segmentId = roomState.attributes?.segment_id;
|
|
175749
175753
|
const roomName = roomState.state;
|
|
175750
175754
|
let matchedAreaId = null;
|
|
175751
175755
|
if (segmentId != null) {
|
|
175752
|
-
if (
|
|
175756
|
+
if (this.activeAreas.includes(segmentId)) {
|
|
175753
175757
|
matchedAreaId = segmentId;
|
|
175754
175758
|
}
|
|
175755
175759
|
}
|
|
@@ -175757,7 +175761,7 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175757
175761
|
const area = serviceArea.state.supportedAreas.find(
|
|
175758
175762
|
(a) => a.areaInfo.locationInfo?.locationName?.toLowerCase() === roomName.toLowerCase()
|
|
175759
175763
|
);
|
|
175760
|
-
if (area &&
|
|
175764
|
+
if (area && this.activeAreas.includes(area.areaId)) {
|
|
175761
175765
|
matchedAreaId = area.areaId;
|
|
175762
175766
|
}
|
|
175763
175767
|
}
|
|
@@ -175796,21 +175800,20 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175796
175800
|
* - null: mark all areas as Completed (cleaning done)
|
|
175797
175801
|
* - areaId: mark that area as Operating, others as Pending
|
|
175798
175802
|
*
|
|
175799
|
-
*
|
|
175800
|
-
*
|
|
175801
|
-
*
|
|
175803
|
+
* Uses the activeAreas snapshot (plain number array) instead of
|
|
175804
|
+
* managed state entries, which avoids infinite recursion in
|
|
175805
|
+
* matter.js property getters during transaction pre-commit.
|
|
175802
175806
|
*/
|
|
175803
175807
|
updateProgress(serviceArea, areaId) {
|
|
175808
|
+
if (this.activeAreas.length === 0) return;
|
|
175804
175809
|
const state = serviceArea.state;
|
|
175805
|
-
const selectedAreas = serviceArea.state.selectedAreas;
|
|
175806
|
-
if (!selectedAreas || selectedAreas.length === 0) return;
|
|
175807
175810
|
if (areaId === null) {
|
|
175808
|
-
state.progress =
|
|
175811
|
+
state.progress = this.activeAreas.map((id) => ({
|
|
175809
175812
|
areaId: id,
|
|
175810
175813
|
status: ServiceArea3.OperationalStatus.Completed
|
|
175811
175814
|
}));
|
|
175812
175815
|
} else {
|
|
175813
|
-
state.progress =
|
|
175816
|
+
state.progress = this.activeAreas.map((id) => ({
|
|
175814
175817
|
areaId: id,
|
|
175815
175818
|
status: id === areaId ? ServiceArea3.OperationalStatus.Operating : this.completedAreas.has(id) ? ServiceArea3.OperationalStatus.Completed : ServiceArea3.OperationalStatus.Pending
|
|
175816
175819
|
}));
|
|
@@ -175846,7 +175849,8 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175846
175849
|
try {
|
|
175847
175850
|
const serviceArea = this.agent.get(ServiceAreaBehavior);
|
|
175848
175851
|
if (serviceArea.state.selectedAreas?.length > 0) {
|
|
175849
|
-
this.
|
|
175852
|
+
this.activeAreas = [...serviceArea.state.selectedAreas];
|
|
175853
|
+
this.trySetCurrentArea(this.activeAreas[0]);
|
|
175850
175854
|
homeAssistant.callAction(this.state.config.start(void 0, this.agent));
|
|
175851
175855
|
this.state.currentMode = newMode;
|
|
175852
175856
|
return {
|
|
@@ -175857,7 +175861,9 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175857
175861
|
} catch {
|
|
175858
175862
|
}
|
|
175859
175863
|
if (this.state.config.cleanRoom) {
|
|
175860
|
-
this.
|
|
175864
|
+
const areaId = this.findAreaIdForMode(newMode);
|
|
175865
|
+
this.activeAreas = areaId !== null ? [areaId] : [];
|
|
175866
|
+
this.trySetCurrentArea(areaId);
|
|
175861
175867
|
homeAssistant.callAction(
|
|
175862
175868
|
this.state.config.cleanRoom(newMode, this.agent)
|
|
175863
175869
|
);
|
|
@@ -175873,7 +175879,8 @@ var RvcRunModeServerBase = class extends RvcRunModeServer {
|
|
|
175873
175879
|
try {
|
|
175874
175880
|
const serviceArea = this.agent.get(ServiceAreaBehavior);
|
|
175875
175881
|
if (serviceArea.state.selectedAreas?.length > 0) {
|
|
175876
|
-
this.
|
|
175882
|
+
this.activeAreas = [...serviceArea.state.selectedAreas];
|
|
175883
|
+
this.trySetCurrentArea(this.activeAreas[0]);
|
|
175877
175884
|
}
|
|
175878
175885
|
} catch {
|
|
175879
175886
|
}
|
|
@@ -178193,18 +178200,10 @@ var deviceCtrs = {
|
|
|
178193
178200
|
event: EventDevice
|
|
178194
178201
|
};
|
|
178195
178202
|
var matterDeviceTypeFactories = {
|
|
178196
|
-
on_off_light: (ha) => OnOffLightType.set({
|
|
178197
|
-
|
|
178198
|
-
}),
|
|
178199
|
-
|
|
178200
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178201
|
-
}),
|
|
178202
|
-
color_temperature_light: (ha) => ColorTemperatureLightType.set({
|
|
178203
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178204
|
-
}),
|
|
178205
|
-
extended_color_light: (ha) => ExtendedColorLightType(true, true).set({
|
|
178206
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178207
|
-
}),
|
|
178203
|
+
on_off_light: (ha) => OnOffLightType.set({ homeAssistantEntity: ha }),
|
|
178204
|
+
dimmable_light: (ha) => DimmableLightType.set({ homeAssistantEntity: ha }),
|
|
178205
|
+
color_temperature_light: (ha) => ColorTemperatureLightType.set({ homeAssistantEntity: ha }),
|
|
178206
|
+
extended_color_light: (ha) => ExtendedColorLightType(true, true).set({ homeAssistantEntity: ha }),
|
|
178208
178207
|
on_off_plugin_unit: (ha) => {
|
|
178209
178208
|
const domain = ha.entity.entity_id.split(".")[0];
|
|
178210
178209
|
if (domain === "alarm_control_panel") {
|
|
@@ -178212,9 +178211,7 @@ var matterDeviceTypeFactories = {
|
|
|
178212
178211
|
}
|
|
178213
178212
|
return SwitchDevice(ha);
|
|
178214
178213
|
},
|
|
178215
|
-
dimmable_plugin_unit: (ha) => DimmablePlugInUnitType.set({
|
|
178216
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178217
|
-
}),
|
|
178214
|
+
dimmable_plugin_unit: (ha) => DimmablePlugInUnitType.set({ homeAssistantEntity: ha }),
|
|
178218
178215
|
on_off_switch: SwitchDevice,
|
|
178219
178216
|
door_lock: LockDevice,
|
|
178220
178217
|
window_covering: CoverDevice,
|
|
@@ -178225,77 +178222,33 @@ var matterDeviceTypeFactories = {
|
|
|
178225
178222
|
humidifier_dehumidifier: HumidifierDevice,
|
|
178226
178223
|
speaker: MediaPlayerDevice,
|
|
178227
178224
|
basic_video_player: VideoPlayerDevice,
|
|
178228
|
-
humidity_sensor: (ha) => HumiditySensorType.set({
|
|
178229
|
-
|
|
178230
|
-
}),
|
|
178231
|
-
|
|
178232
|
-
|
|
178233
|
-
}),
|
|
178234
|
-
|
|
178235
|
-
|
|
178236
|
-
}),
|
|
178237
|
-
|
|
178238
|
-
|
|
178239
|
-
}),
|
|
178240
|
-
|
|
178241
|
-
|
|
178242
|
-
}),
|
|
178243
|
-
|
|
178244
|
-
|
|
178245
|
-
}),
|
|
178246
|
-
battery_storage: (ha) => BatterySensorType.set({
|
|
178247
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178248
|
-
}),
|
|
178249
|
-
tvoc_sensor: (ha) => TvocSensorType.set({
|
|
178250
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178251
|
-
}),
|
|
178252
|
-
carbon_monoxide_sensor: (ha) => CarbonMonoxideSensorType.set({
|
|
178253
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178254
|
-
}),
|
|
178255
|
-
nitrogen_dioxide_sensor: (ha) => NitrogenDioxideSensorType.set({
|
|
178256
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178257
|
-
}),
|
|
178258
|
-
ozone_sensor: (ha) => OzoneSensorType.set({
|
|
178259
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178260
|
-
}),
|
|
178261
|
-
formaldehyde_sensor: (ha) => FormaldehydeSensorType.set({
|
|
178262
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178263
|
-
}),
|
|
178264
|
-
radon_sensor: (ha) => RadonSensorType.set({
|
|
178265
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178266
|
-
}),
|
|
178267
|
-
pm1_sensor: (ha) => Pm1SensorType.set({
|
|
178268
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178269
|
-
}),
|
|
178270
|
-
electrical_sensor: (ha) => ElectricalSensorType.set({
|
|
178271
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178272
|
-
}),
|
|
178273
|
-
contact_sensor: (ha) => ContactSensorType.set({
|
|
178274
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178275
|
-
}),
|
|
178276
|
-
motion_sensor: (ha) => MotionSensorType.set({
|
|
178277
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178278
|
-
}),
|
|
178279
|
-
occupancy_sensor: (ha) => OccupancySensorType.set({
|
|
178280
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178281
|
-
}),
|
|
178225
|
+
humidity_sensor: (ha) => HumiditySensorType.set({ homeAssistantEntity: ha }),
|
|
178226
|
+
temperature_sensor: (ha) => TemperatureSensorType.set({ homeAssistantEntity: ha }),
|
|
178227
|
+
pressure_sensor: (ha) => PressureSensorType.set({ homeAssistantEntity: ha }),
|
|
178228
|
+
light_sensor: (ha) => IlluminanceSensorType.set({ homeAssistantEntity: ha }),
|
|
178229
|
+
flow_sensor: (ha) => FlowSensorType.set({ homeAssistantEntity: ha }),
|
|
178230
|
+
air_quality_sensor: (ha) => AirQualitySensorType.set({ homeAssistantEntity: ha }),
|
|
178231
|
+
battery_storage: (ha) => BatterySensorType.set({ homeAssistantEntity: ha }),
|
|
178232
|
+
tvoc_sensor: (ha) => TvocSensorType.set({ homeAssistantEntity: ha }),
|
|
178233
|
+
carbon_monoxide_sensor: (ha) => CarbonMonoxideSensorType.set({ homeAssistantEntity: ha }),
|
|
178234
|
+
nitrogen_dioxide_sensor: (ha) => NitrogenDioxideSensorType.set({ homeAssistantEntity: ha }),
|
|
178235
|
+
ozone_sensor: (ha) => OzoneSensorType.set({ homeAssistantEntity: ha }),
|
|
178236
|
+
formaldehyde_sensor: (ha) => FormaldehydeSensorType.set({ homeAssistantEntity: ha }),
|
|
178237
|
+
radon_sensor: (ha) => RadonSensorType.set({ homeAssistantEntity: ha }),
|
|
178238
|
+
pm1_sensor: (ha) => Pm1SensorType.set({ homeAssistantEntity: ha }),
|
|
178239
|
+
electrical_sensor: (ha) => ElectricalSensorType.set({ homeAssistantEntity: ha }),
|
|
178240
|
+
contact_sensor: (ha) => ContactSensorType.set({ homeAssistantEntity: ha }),
|
|
178241
|
+
motion_sensor: (ha) => MotionSensorType.set({ homeAssistantEntity: ha }),
|
|
178242
|
+
occupancy_sensor: (ha) => OccupancySensorType.set({ homeAssistantEntity: ha }),
|
|
178282
178243
|
mode_select: SelectDevice,
|
|
178283
178244
|
water_valve: ValveDevice,
|
|
178284
178245
|
pump: PumpEndpoint,
|
|
178285
|
-
rain_sensor: (ha) => RainSensorType.set({
|
|
178286
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178287
|
-
}),
|
|
178246
|
+
rain_sensor: (ha) => RainSensorType.set({ homeAssistantEntity: ha }),
|
|
178288
178247
|
water_heater: WaterHeaterDevice,
|
|
178289
178248
|
generic_switch: EventDevice,
|
|
178290
|
-
smoke_co_alarm: (ha) => SmokeAlarmType.set({
|
|
178291
|
-
|
|
178292
|
-
})
|
|
178293
|
-
water_freeze_detector: (ha) => WaterFreezeDetectorType.set({
|
|
178294
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178295
|
-
}),
|
|
178296
|
-
water_leak_detector: (ha) => WaterLeakDetectorType.set({
|
|
178297
|
-
homeAssistantEntity: { entity: ha.entity, customName: ha.customName }
|
|
178298
|
-
})
|
|
178249
|
+
smoke_co_alarm: (ha) => SmokeAlarmType.set({ homeAssistantEntity: ha }),
|
|
178250
|
+
water_freeze_detector: (ha) => WaterFreezeDetectorType.set({ homeAssistantEntity: ha }),
|
|
178251
|
+
water_leak_detector: (ha) => WaterLeakDetectorType.set({ homeAssistantEntity: ha })
|
|
178299
178252
|
};
|
|
178300
178253
|
|
|
178301
178254
|
// src/matter/endpoints/composed/user-composed-endpoint.ts
|