@riddix/hamh 2.1.0-alpha.482 → 2.1.0-alpha.483

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.
@@ -170281,6 +170281,9 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
170281
170281
  // Track when the last command was received to implement two-phase debounce
170282
170282
  lastLiftCommandTime = 0;
170283
170283
  lastTiltCommandTime = 0;
170284
+ // Track lift direction to skip redundant tilt on downOrClose / upOrOpen (#246)
170285
+ lastLiftMovementMs = 0;
170286
+ lastLiftMovementDirection = null;
170284
170287
  // Store everything needed for debounced HA calls - entityId and actions service
170285
170288
  // must be captured before setTimeout because agent context expires after command handler
170286
170289
  pendingLiftAction = null;
@@ -170403,6 +170406,8 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
170403
170406
  `handleMovement: type=${MovementType[type]}, direction=${MovementDirection[direction]}, target=${targetPercent100ths}, currentLift=${currentLift}, currentTilt=${currentTilt}, absolutePosition=${this.features.absolutePosition}`
170404
170407
  );
170405
170408
  if (type === MovementType.Lift) {
170409
+ this.lastLiftMovementMs = Date.now();
170410
+ this.lastLiftMovementDirection = direction;
170406
170411
  if (targetPercent100ths === 0) {
170407
170412
  this.handleLiftOpen();
170408
170413
  } else if (targetPercent100ths === 1e4) {
@@ -170415,6 +170420,12 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
170415
170420
  this.handleLiftClose();
170416
170421
  }
170417
170422
  } else if (type === MovementType.Tilt) {
170423
+ if (targetPercent100ths == null && this.lastLiftMovementDirection === direction && Date.now() - this.lastLiftMovementMs < 50) {
170424
+ logger175.info(
170425
+ `Skipping tilt ${MovementDirection[direction]} \u2014 lift already moving in same direction`
170426
+ );
170427
+ return;
170428
+ }
170418
170429
  if (targetPercent100ths === 0) {
170419
170430
  this.handleTiltOpen();
170420
170431
  } else if (targetPercent100ths === 1e4) {