@riddix/hamh 2.1.0-alpha.618 → 2.1.0-alpha.619

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.
@@ -172058,11 +172058,13 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
172058
172058
  logger178.debug(
172059
172059
  `Cover update for ${entity.entity_id}: state=${state.state}, lift=${currentLift}%, tilt=${currentTilt}%, movement=${MovementStatus[movementStatus]}`
172060
172060
  );
172061
+ const overrideType = config10.getCoverType?.(state, this.agent);
172062
+ const overrideEndProduct = config10.getEndProductType?.(state, this.agent);
172061
172063
  const appliedPatch = applyPatchState(
172062
172064
  this.state,
172063
172065
  {
172064
- type: this.features.lift && this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindLift : this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindTiltOnly : WindowCovering3.WindowCoveringType.Rollershade,
172065
- endProductType: this.features.lift && this.features.tilt ? WindowCovering3.EndProductType.SheerShade : this.features.tilt ? WindowCovering3.EndProductType.TiltOnlyInteriorBlind : WindowCovering3.EndProductType.RollerShade,
172066
+ type: overrideType ?? (this.features.lift && this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindLift : this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindTiltOnly : WindowCovering3.WindowCoveringType.Rollershade),
172067
+ endProductType: overrideEndProduct ?? (this.features.lift && this.features.tilt ? WindowCovering3.EndProductType.SheerShade : this.features.tilt ? WindowCovering3.EndProductType.TiltOnlyInteriorBlind : WindowCovering3.EndProductType.RollerShade),
172066
172068
  operationalStatus: {
172067
172069
  global: movementStatus,
172068
172070
  ...this.features.lift ? { lift: movementStatus } : {},
@@ -172282,6 +172284,33 @@ function adjustPositionForWriting(position, flags2, matterSemantics) {
172282
172284
  // src/matter/endpoints/legacy/cover/behaviors/cover-window-covering-server.ts
172283
172285
  var logger179 = Logger.get("CoverWindowCoveringServer");
172284
172286
  var attributes5 = (entity) => entity.attributes;
172287
+ var DEVICE_CLASS_TO_MATTER_TYPE = {
172288
+ curtain: {
172289
+ type: WindowCovering3.WindowCoveringType.Drapery,
172290
+ endProductType: WindowCovering3.EndProductType.CentralCurtain
172291
+ },
172292
+ awning: {
172293
+ type: WindowCovering3.WindowCoveringType.Awning,
172294
+ endProductType: WindowCovering3.EndProductType.AwningTerracePatio
172295
+ },
172296
+ shutter: {
172297
+ type: WindowCovering3.WindowCoveringType.Shutter,
172298
+ endProductType: WindowCovering3.EndProductType.RollerShutter
172299
+ },
172300
+ blind: {
172301
+ type: WindowCovering3.WindowCoveringType.TiltBlindTiltOnly,
172302
+ endProductType: WindowCovering3.EndProductType.InteriorBlind
172303
+ },
172304
+ shade: {
172305
+ type: WindowCovering3.WindowCoveringType.Rollershade,
172306
+ endProductType: WindowCovering3.EndProductType.RollerShade
172307
+ }
172308
+ };
172309
+ var deviceClassMapping = (entity) => {
172310
+ const raw = entity.attributes.device_class;
172311
+ if (typeof raw !== "string") return void 0;
172312
+ return DEVICE_CLASS_TO_MATTER_TYPE[raw.toLowerCase()];
172313
+ };
172285
172314
  var MATTER_SEMANTIC_PLATFORMS = [
172286
172315
  // Currently empty - no known platforms use Matter semantics by default
172287
172316
  // Add platforms here only if confirmed to use 0=open, 100=closed
@@ -172340,6 +172369,8 @@ var config5 = {
172340
172369
  }
172341
172370
  return position == null ? null : adjustPositionForReading2(position, agent);
172342
172371
  },
172372
+ getCoverType: (entity) => deviceClassMapping(entity)?.type,
172373
+ getEndProductType: (entity) => deviceClassMapping(entity)?.endProductType,
172343
172374
  getMovementStatus: (entity, agent) => {
172344
172375
  const { featureFlags } = agent.env.get(BridgeDataProvider);
172345
172376
  const swapped = featureFlags?.coverSwapOpenClose === true;