@riddix/hamh 2.1.0-alpha.617 → 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.
@@ -169565,7 +169565,10 @@ var fanControlConfig = {
169565
169565
  );
169566
169566
  },
169567
169567
  turnOff: () => ({ action: "fan.turn_off" }),
169568
- turnOn: (percentage) => ({ action: "fan.turn_on", data: { percentage } }),
169568
+ turnOn: (percentage) => ({
169569
+ action: "fan.set_percentage",
169570
+ data: { percentage }
169571
+ }),
169569
169572
  setAutoMode: () => ({ action: "fan.turn_on", data: { preset_mode: "Auto" } }),
169570
169573
  setAirflowDirection: (direction) => ({
169571
169574
  action: "fan.set_direction",
@@ -172055,11 +172058,13 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
172055
172058
  logger178.debug(
172056
172059
  `Cover update for ${entity.entity_id}: state=${state.state}, lift=${currentLift}%, tilt=${currentTilt}%, movement=${MovementStatus[movementStatus]}`
172057
172060
  );
172061
+ const overrideType = config10.getCoverType?.(state, this.agent);
172062
+ const overrideEndProduct = config10.getEndProductType?.(state, this.agent);
172058
172063
  const appliedPatch = applyPatchState(
172059
172064
  this.state,
172060
172065
  {
172061
- type: this.features.lift && this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindLift : this.features.tilt ? WindowCovering3.WindowCoveringType.TiltBlindTiltOnly : WindowCovering3.WindowCoveringType.Rollershade,
172062
- 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),
172063
172068
  operationalStatus: {
172064
172069
  global: movementStatus,
172065
172070
  ...this.features.lift ? { lift: movementStatus } : {},
@@ -172279,6 +172284,33 @@ function adjustPositionForWriting(position, flags2, matterSemantics) {
172279
172284
  // src/matter/endpoints/legacy/cover/behaviors/cover-window-covering-server.ts
172280
172285
  var logger179 = Logger.get("CoverWindowCoveringServer");
172281
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
+ };
172282
172314
  var MATTER_SEMANTIC_PLATFORMS = [
172283
172315
  // Currently empty - no known platforms use Matter semantics by default
172284
172316
  // Add platforms here only if confirmed to use 0=open, 100=closed
@@ -172337,6 +172369,8 @@ var config5 = {
172337
172369
  }
172338
172370
  return position == null ? null : adjustPositionForReading2(position, agent);
172339
172371
  },
172372
+ getCoverType: (entity) => deviceClassMapping(entity)?.type,
172373
+ getEndProductType: (entity) => deviceClassMapping(entity)?.endProductType,
172340
172374
  getMovementStatus: (entity, agent) => {
172341
172375
  const { featureFlags } = agent.env.get(BridgeDataProvider);
172342
172376
  const swapped = featureFlags?.coverSwapOpenClose === true;