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

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.
@@ -171698,8 +171698,8 @@ var config4 = {
171698
171698
  const direction = getHeatCoolOnlyDirection(entity, agent);
171699
171699
  return direction === "cooling" ? Thermostat3.SystemMode.Cool : Thermostat3.SystemMode.Heat;
171700
171700
  }
171701
- const hasHeatCool = modes.includes(ClimateHvacMode.heat_cool);
171702
- if (hasHeatCool) {
171701
+ const hasMatterAuto = modes.includes(ClimateHvacMode.heat_cool) || modes.includes(ClimateHvacMode.auto);
171702
+ if (hasMatterAuto) {
171703
171703
  return systemMode;
171704
171704
  }
171705
171705
  const hasCooling = modes.some((m) => m === ClimateHvacMode.cool);
@@ -171887,7 +171887,7 @@ function ClimateDevice(homeAssistantEntity) {
171887
171887
  minCoolSetpointLimit: toMatterTemp(attributes7.min_temp) ?? 0,
171888
171888
  maxCoolSetpointLimit: toMatterTemp(attributes7.max_temp) ?? 5e3
171889
171889
  };
171890
- const autoMode = supportsHeating && supportsCooling && attributes7.hvac_modes.includes(ClimateHvacMode.heat_cool) && (attributes7.hvac_modes.includes(ClimateHvacMode.heat) || attributes7.hvac_modes.includes(ClimateHvacMode.cool));
171890
+ const autoMode = supportsHeating && supportsCooling && (attributes7.hvac_modes.includes(ClimateHvacMode.heat_cool) || attributes7.hvac_modes.includes(ClimateHvacMode.auto)) && (attributes7.hvac_modes.includes(ClimateHvacMode.heat) || attributes7.hvac_modes.includes(ClimateHvacMode.cool));
171891
171891
  return ClimateDeviceType(
171892
171892
  supportsOnOff,
171893
171893
  supportsHumidity,
@@ -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;