@riddix/hamh 2.1.0-alpha.520 → 2.1.0-alpha.521
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
|
@@ -171012,6 +171012,22 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
171012
171012
|
);
|
|
171013
171013
|
const currentTilt100ths = currentTilt != null ? currentTilt * 100 : null;
|
|
171014
171014
|
const isStopped = movementStatus === MovementStatus.Stopped;
|
|
171015
|
+
const inferTarget = (current100ths, existing100ths) => {
|
|
171016
|
+
if (isStopped) return current100ths;
|
|
171017
|
+
if (movementStatus === MovementStatus.Opening) {
|
|
171018
|
+
if (existing100ths != null && current100ths != null && existing100ths < current100ths) {
|
|
171019
|
+
return existing100ths;
|
|
171020
|
+
}
|
|
171021
|
+
return 0;
|
|
171022
|
+
}
|
|
171023
|
+
if (movementStatus === MovementStatus.Closing) {
|
|
171024
|
+
if (existing100ths != null && current100ths != null && existing100ths > current100ths) {
|
|
171025
|
+
return existing100ths;
|
|
171026
|
+
}
|
|
171027
|
+
return 1e4;
|
|
171028
|
+
}
|
|
171029
|
+
return existing100ths ?? current100ths;
|
|
171030
|
+
};
|
|
171015
171031
|
logger175.debug(
|
|
171016
171032
|
`Cover update for ${entity.entity_id}: state=${state.state}, lift=${currentLift}%, tilt=${currentTilt}%, movement=${MovementStatus[movementStatus]}`
|
|
171017
171033
|
);
|
|
@@ -171038,14 +171054,18 @@ var WindowCoveringServerBase = class _WindowCoveringServerBase extends FeaturedB
|
|
|
171038
171054
|
...this.features.positionAwareLift ? {
|
|
171039
171055
|
currentPositionLiftPercentage: currentLift,
|
|
171040
171056
|
currentPositionLiftPercent100ths: currentLift100ths,
|
|
171041
|
-
|
|
171042
|
-
|
|
171057
|
+
targetPositionLiftPercent100ths: inferTarget(
|
|
171058
|
+
currentLift100ths,
|
|
171059
|
+
this.state.targetPositionLiftPercent100ths
|
|
171060
|
+
)
|
|
171043
171061
|
} : {},
|
|
171044
171062
|
...this.features.positionAwareTilt ? {
|
|
171045
171063
|
currentPositionTiltPercentage: currentTilt,
|
|
171046
171064
|
currentPositionTiltPercent100ths: currentTilt100ths,
|
|
171047
|
-
|
|
171048
|
-
|
|
171065
|
+
targetPositionTiltPercent100ths: inferTarget(
|
|
171066
|
+
currentTilt100ths,
|
|
171067
|
+
this.state.targetPositionTiltPercent100ths
|
|
171068
|
+
)
|
|
171049
171069
|
} : {}
|
|
171050
171070
|
}
|
|
171051
171071
|
);
|