refactor(cli, ups-handler, daemon, migrations): remove thresholds handling and update migration order logic
Some checks failed
CI / Type Check & Lint (push) Failing after 4s
CI / Build Test (Current Platform) (push) Successful in 5s
Release / build-and-release (push) Successful in 41s
CI / Build All Platforms (push) Successful in 46s

This commit is contained in:
2025-10-20 12:03:14 +00:00
parent 2c8ea44d40
commit afd026d08c
8 changed files with 33 additions and 53 deletions

View File

@@ -304,8 +304,6 @@ export class NupstDaemon {
batteryRuntime: 999, // High value as default
lastStatusChange: Date.now(),
lastCheckTime: 0,
thresholdsExceeded: false,
lastThresholdCrossing: 0,
});
}
@@ -553,23 +551,7 @@ export class NupstDaemon {
// Check threshold conditions
if (
status.batteryCapacity < ups.thresholds.battery ||
status.batteryRuntime < ups.thresholds.runtime
) {
logger.logBoxTitle(`UPS Shutdown Required: ${ups.name}`, 50);
logger.logBoxLine(
`Battery: ${status.batteryCapacity}% (threshold: ${ups.thresholds.battery}%)`,
);
logger.logBoxLine(
`Runtime: ${status.batteryRuntime} min (threshold: ${ups.thresholds.runtime} min)`,
);
logger.logBoxEnd();
await this.initiateShutdown(`UPS "${ups.name}" battery or runtime below threshold`);
}
}
/**
* Build action context from UPS state