feat(daemon): Add UPSD (NUT) protocol support, Proxmox VM shutdown action, pause/resume monitoring, and network-loss/unreachable handling; bump config version to 4.2
This commit is contained in:
@@ -34,10 +34,17 @@ export class ShutdownAction extends Action {
|
||||
|
||||
// CRITICAL SAFETY CHECK: Shutdown should NEVER trigger unless UPS is on battery
|
||||
// A low battery while on grid power is not an emergency (the battery is charging)
|
||||
// When UPS is unreachable, we don't know the actual state - don't trigger false shutdown
|
||||
if (context.powerStatus !== 'onBattery') {
|
||||
logger.info(
|
||||
`Shutdown action skipped: UPS is not on battery (status: ${context.powerStatus})`,
|
||||
);
|
||||
if (context.powerStatus === 'unreachable') {
|
||||
logger.info(
|
||||
`Shutdown action skipped: UPS is unreachable (communication failure, actual state unknown)`,
|
||||
);
|
||||
} else {
|
||||
logger.info(
|
||||
`Shutdown action skipped: UPS is not on battery (status: ${context.powerStatus})`,
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user