@riddix/hamh 2.1.0-alpha.540 → 2.1.0-alpha.542
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
|
@@ -171790,19 +171790,24 @@ var CoverWindowCoveringServer = WindowCoveringServer2(config5);
|
|
|
171790
171790
|
|
|
171791
171791
|
// src/matter/endpoints/legacy/cover/index.ts
|
|
171792
171792
|
var logger179 = Logger.get("CoverDevice");
|
|
171793
|
-
var
|
|
171793
|
+
var DISCRETE_COVER_CLASSES = /* @__PURE__ */ new Set(["garage", "gate"]);
|
|
171794
|
+
var CoverDeviceType = (supportedFeatures, hasBattery, entityId, isDiscrete) => {
|
|
171794
171795
|
const features2 = /* @__PURE__ */ new Set();
|
|
171795
171796
|
if (testBit(supportedFeatures, CoverSupportedFeatures.support_open)) {
|
|
171796
171797
|
features2.add("Lift");
|
|
171797
171798
|
features2.add("PositionAwareLift");
|
|
171798
|
-
|
|
171799
|
+
if (!isDiscrete) {
|
|
171800
|
+
features2.add("AbsolutePosition");
|
|
171801
|
+
}
|
|
171799
171802
|
} else {
|
|
171800
171803
|
logger179.warn(
|
|
171801
171804
|
`[${entityId}] Cover has no support_open feature (supported_features=${supportedFeatures}), adding Lift anyway`
|
|
171802
171805
|
);
|
|
171803
171806
|
features2.add("Lift");
|
|
171804
171807
|
features2.add("PositionAwareLift");
|
|
171805
|
-
|
|
171808
|
+
if (!isDiscrete) {
|
|
171809
|
+
features2.add("AbsolutePosition");
|
|
171810
|
+
}
|
|
171806
171811
|
}
|
|
171807
171812
|
if (testBit(supportedFeatures, CoverSupportedFeatures.support_open_tilt)) {
|
|
171808
171813
|
features2.add("Tilt");
|
|
@@ -171846,10 +171851,18 @@ function CoverDevice(homeAssistantEntity) {
|
|
|
171846
171851
|
`[${entityId}] Creating cover without battery (batteryAttr=${hasBatteryAttr}, batteryEntity=${homeAssistantEntity.mapping?.batteryEntity ?? "none"})`
|
|
171847
171852
|
);
|
|
171848
171853
|
}
|
|
171854
|
+
const deviceClass = attributes7.device_class;
|
|
171855
|
+
const isDiscrete = typeof deviceClass === "string" && DISCRETE_COVER_CLASSES.has(deviceClass.toLowerCase());
|
|
171856
|
+
if (isDiscrete) {
|
|
171857
|
+
logger179.info(
|
|
171858
|
+
`[${entityId}] Garage/gate cover (device_class=${deviceClass}): using discrete Open/Close mode`
|
|
171859
|
+
);
|
|
171860
|
+
}
|
|
171849
171861
|
return CoverDeviceType(
|
|
171850
171862
|
attributes7.supported_features ?? 0,
|
|
171851
171863
|
hasBattery,
|
|
171852
|
-
entityId
|
|
171864
|
+
entityId,
|
|
171865
|
+
isDiscrete
|
|
171853
171866
|
).set({
|
|
171854
171867
|
homeAssistantEntity
|
|
171855
171868
|
});
|
|
@@ -178173,6 +178186,11 @@ var matterDeviceTypeFactories = {
|
|
|
178173
178186
|
|
|
178174
178187
|
// src/matter/endpoints/composed/user-composed-endpoint.ts
|
|
178175
178188
|
var logger199 = Logger.get("UserComposedEndpoint");
|
|
178189
|
+
function stripBasicInformation(type) {
|
|
178190
|
+
const behaviors = { ...type.behaviors };
|
|
178191
|
+
delete behaviors.bridgedDeviceBasicInformation;
|
|
178192
|
+
return { ...type, behaviors };
|
|
178193
|
+
}
|
|
178176
178194
|
function createEndpointId4(entityId, customName) {
|
|
178177
178195
|
const baseName = customName || entityId;
|
|
178178
178196
|
return baseName.replace(/\./g, "_").replace(/\s+/g, "_");
|
|
@@ -178228,7 +178246,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
178228
178246
|
);
|
|
178229
178247
|
return void 0;
|
|
178230
178248
|
}
|
|
178231
|
-
const primarySub = new Endpoint(primaryType, {
|
|
178249
|
+
const primarySub = new Endpoint(stripBasicInformation(primaryType), {
|
|
178232
178250
|
id: `${endpointId}_primary`
|
|
178233
178251
|
});
|
|
178234
178252
|
parts.push(primarySub);
|
|
@@ -178254,7 +178272,7 @@ var UserComposedEndpoint = class _UserComposedEndpoint extends Endpoint {
|
|
|
178254
178272
|
);
|
|
178255
178273
|
continue;
|
|
178256
178274
|
}
|
|
178257
|
-
const subEndpoint = new Endpoint(subType, {
|
|
178275
|
+
const subEndpoint = new Endpoint(stripBasicInformation(subType), {
|
|
178258
178276
|
id: `${endpointId}_sub_${i}`
|
|
178259
178277
|
});
|
|
178260
178278
|
parts.push(subEndpoint);
|