refactor(cli, ups-handler, daemon, migrations): remove thresholds handling and update migration order logic
This commit is contained in:
@@ -559,10 +559,6 @@ export class UpsHandler {
|
||||
);
|
||||
logger.logBoxLine(` Battery Runtime: ${snmpConfig.customOIDs.BATTERY_RUNTIME || 'Not set'}`);
|
||||
}
|
||||
logger.logBoxLine('Thresholds:');
|
||||
logger.logBoxLine(` Battery: ${thresholds.battery}%`);
|
||||
logger.logBoxLine(` Runtime: ${thresholds.runtime} minutes`);
|
||||
|
||||
// Show group assignments if this is a UPS config
|
||||
if (config.groups && Array.isArray(config.groups)) {
|
||||
logger.logBoxLine(
|
||||
@@ -586,7 +582,6 @@ export class UpsHandler {
|
||||
try {
|
||||
// Create a test config with a short timeout
|
||||
const snmpConfig = config.snmp ? config.snmp : config.snmp;
|
||||
const thresholds = config.thresholds ? config.thresholds : config.thresholds;
|
||||
|
||||
const testConfig = {
|
||||
...snmpConfig,
|
||||
@@ -603,10 +598,7 @@ export class UpsHandler {
|
||||
logger.logBoxLine(` Runtime Remaining: ${status.batteryRuntime} minutes`);
|
||||
logger.logBoxEnd();
|
||||
|
||||
// Check status against thresholds if on battery
|
||||
if (status.powerStatus === 'onBattery') {
|
||||
this.analyzeThresholds(status, thresholds);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
const errorBoxWidth = 45;
|
||||
logger.logBoxTitle(`Connection Failed: ${upsName}`, errorBoxWidth);
|
||||
@@ -1083,9 +1075,7 @@ export class UpsHandler {
|
||||
logger.logBoxLine(`SNMP Host: ${ups.snmp.host}:${ups.snmp.port}`);
|
||||
logger.logBoxLine(`SNMP Version: ${ups.snmp.version}`);
|
||||
logger.logBoxLine(`UPS Model: ${ups.snmp.upsModel}`);
|
||||
logger.logBoxLine(
|
||||
`Thresholds: ${ups.thresholds.battery}% battery, ${ups.thresholds.runtime} min runtime`,
|
||||
);
|
||||
|
||||
if (ups.groups && ups.groups.length > 0) {
|
||||
logger.logBoxLine(`Groups: ${ups.groups.join(', ')}`);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user