@riddix/hamh 2.1.0-alpha.386 → 2.1.0-alpha.387
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
|
@@ -165580,19 +165580,20 @@ var ComposedSensorEndpoint = class _ComposedSensorEndpoint extends Endpoint {
|
|
|
165580
165580
|
scheduleUpdate(endpoint, entityId, states) {
|
|
165581
165581
|
const state = states[entityId];
|
|
165582
165582
|
if (!state) return;
|
|
165583
|
+
const key = endpoint === this ? `_parent_:${entityId}` : entityId;
|
|
165583
165584
|
const stateJson = JSON.stringify({
|
|
165584
165585
|
s: state.state,
|
|
165585
165586
|
a: state.attributes
|
|
165586
165587
|
});
|
|
165587
|
-
if (this.lastStates.get(
|
|
165588
|
-
this.lastStates.set(
|
|
165589
|
-
let debouncedFn = this.debouncedUpdates.get(
|
|
165588
|
+
if (this.lastStates.get(key) === stateJson) return;
|
|
165589
|
+
this.lastStates.set(key, stateJson);
|
|
165590
|
+
let debouncedFn = this.debouncedUpdates.get(key);
|
|
165590
165591
|
if (!debouncedFn) {
|
|
165591
165592
|
debouncedFn = debounce2(
|
|
165592
165593
|
(ep, s) => this.flushUpdate(ep, s),
|
|
165593
165594
|
50
|
|
165594
165595
|
);
|
|
165595
|
-
this.debouncedUpdates.set(
|
|
165596
|
+
this.debouncedUpdates.set(key, debouncedFn);
|
|
165596
165597
|
}
|
|
165597
165598
|
debouncedFn(endpoint, state);
|
|
165598
165599
|
}
|
|
@@ -171540,6 +171541,9 @@ var TemperaturePressureSensorWithBatteryType = TemperatureSensorDevice.with(
|
|
|
171540
171541
|
);
|
|
171541
171542
|
|
|
171542
171543
|
// src/matter/endpoints/legacy/sensor/index.ts
|
|
171544
|
+
var tempDt = { deviceType: DeviceTypeId(770), revision: 2 };
|
|
171545
|
+
var humidityDt = { deviceType: DeviceTypeId(775), revision: 2 };
|
|
171546
|
+
var pressureDt = { deviceType: DeviceTypeId(773), revision: 2 };
|
|
171543
171547
|
function SensorDevice(homeAssistantEntity) {
|
|
171544
171548
|
const attributes7 = homeAssistantEntity.entity.state.attributes;
|
|
171545
171549
|
const deviceClass = attributes7.device_class;
|
|
@@ -171550,29 +171554,39 @@ function SensorDevice(homeAssistantEntity) {
|
|
|
171550
171554
|
const hasBattery = !!mapping?.batteryEntity;
|
|
171551
171555
|
if (hasHumidity && hasPressure && hasBattery) {
|
|
171552
171556
|
return TemperatureHumidityPressureSensorWithBatteryType.set({
|
|
171553
|
-
homeAssistantEntity
|
|
171557
|
+
homeAssistantEntity,
|
|
171558
|
+
descriptor: { deviceTypeList: [tempDt, humidityDt, pressureDt] }
|
|
171554
171559
|
});
|
|
171555
171560
|
}
|
|
171556
171561
|
if (hasHumidity && hasPressure) {
|
|
171557
171562
|
return TemperatureHumidityPressureSensorType.set({
|
|
171558
|
-
homeAssistantEntity
|
|
171563
|
+
homeAssistantEntity,
|
|
171564
|
+
descriptor: { deviceTypeList: [tempDt, humidityDt, pressureDt] }
|
|
171559
171565
|
});
|
|
171560
171566
|
}
|
|
171561
171567
|
if (hasHumidity && hasBattery) {
|
|
171562
171568
|
return TemperatureHumiditySensorWithBatteryType.set({
|
|
171563
|
-
homeAssistantEntity
|
|
171569
|
+
homeAssistantEntity,
|
|
171570
|
+
descriptor: { deviceTypeList: [tempDt, humidityDt] }
|
|
171564
171571
|
});
|
|
171565
171572
|
}
|
|
171566
171573
|
if (hasHumidity) {
|
|
171567
|
-
return TemperatureHumiditySensorType.set({
|
|
171574
|
+
return TemperatureHumiditySensorType.set({
|
|
171575
|
+
homeAssistantEntity,
|
|
171576
|
+
descriptor: { deviceTypeList: [tempDt, humidityDt] }
|
|
171577
|
+
});
|
|
171568
171578
|
}
|
|
171569
171579
|
if (hasPressure && hasBattery) {
|
|
171570
171580
|
return TemperaturePressureSensorWithBatteryType.set({
|
|
171571
|
-
homeAssistantEntity
|
|
171581
|
+
homeAssistantEntity,
|
|
171582
|
+
descriptor: { deviceTypeList: [tempDt, pressureDt] }
|
|
171572
171583
|
});
|
|
171573
171584
|
}
|
|
171574
171585
|
if (hasPressure) {
|
|
171575
|
-
return TemperaturePressureSensorType.set({
|
|
171586
|
+
return TemperaturePressureSensorType.set({
|
|
171587
|
+
homeAssistantEntity,
|
|
171588
|
+
descriptor: { deviceTypeList: [tempDt, pressureDt] }
|
|
171589
|
+
});
|
|
171576
171590
|
}
|
|
171577
171591
|
if (hasBattery) {
|
|
171578
171592
|
return TemperatureSensorWithBatteryType.set({ homeAssistantEntity });
|