refactor(cli, ups-handler, daemon, migrations): remove thresholds handling and update migration order logic
This commit is contained in:
20
ts/daemon.ts
20
ts/daemon.ts
@@ -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
|
||||
|
Reference in New Issue
Block a user