Interface IMonitorEvents

interface IMonitorEvents {
    *: ((event: string, ...args: any[]) => void);
    BATTERY_CHARGE: ((charge: number, rawCharge: string) => void);
    BATTERY_RUNTIME: ((charge: number, rawCharge: string) => void);
    BYPASS: (() => void);
    CAL: (() => void);
    COMMBAD: (() => void);
    COMMOK: (() => void);
    FSD: (() => void);
    LOWBATT: (() => void);
    NOCOMM: (() => void);
    NOTBYPASS: (() => void);
    NOTCAL: (() => void);
    NOTOFF: (() => void);
    OFF: (() => void);
    ONBATT: (() => void);
    ONLINE: (() => void);
    REPLBATT: (() => void);
    SHUTDOWN: (() => void);
    UNKNOWN_STATUS: ((status: string) => void);
    VARIABLE_CHANGED: ((key: nutVariablesNames, oldValue: string, newValue: string, oldVariables: Partial<Record<nutVariablesNames, string>>, newVariables: Partial<Record<nutVariablesNames, string>>) => void);
    VARIABLES_CHANGED: ((oldVariables: Partial<Record<nutVariablesNames, string>>, newVariables: Partial<Record<nutVariablesNames, string>>) => void);
}

Properties

*: ((event: string, ...args: any[]) => void)

allow to listen to all events

BATTERY_CHARGE: ((charge: number, rawCharge: string) => void)

CHARGE of the battery

Type declaration

    • (charge, rawCharge): void
    • Parameters

      • charge: number

        the current charge of the UPS (can be NaN)

      • rawCharge: string

        the raw value of charge (in case of NaN)

      Returns void

BATTERY_RUNTIME: ((charge: number, rawCharge: string) => void)

RUNTIME of the battery

Type declaration

    • (charge, rawCharge): void
    • Parameters

      • charge: number

        the current charge of the UPS (can be NaN)

      • rawCharge: string

        the raw value of charge (in case of NaN)

      Returns void

BYPASS: (() => void)

UPS on bypass (powered, not protecting).

CAL: (() => void)

UPS calibration in progress.

COMMBAD: (() => void)

Communication with the UPS was just lost.

COMMOK: (() => void)

Communication with the UPS has been established.

FSD: (() => void)

The UPS has been commanded into the "forced shutdown" mode.

LOWBATT: (() => void)

The UPS battery is low (as determined by the driver).

NOCOMM: (() => void)

The UPS can’t be contacted for monitoring.

NOTBYPASS: (() => void)

UPS no longer on bypass.

NOTCAL: (() => void)

UPS calibration finished.

NOTOFF: (() => void)

UPS no longer administratively OFF or asleep.

OFF: (() => void)

UPS administratively OFF or asleep.

ONBATT: (() => void)

The UPS is on battery.

ONLINE: (() => void)

The UPS is back online.

REPLBATT: (() => void)

The UPS needs to have its battery replaced.

SHUTDOWN: (() => void)

The local system is being shut down.

UNKNOWN_STATUS: ((status: string) => void)

UPS STATUS IS UNKNOWN

VARIABLE_CHANGED: ((key: nutVariablesNames, oldValue: string, newValue: string, oldVariables: Partial<Record<nutVariablesNames, string>>, newVariables: Partial<Record<nutVariablesNames, string>>) => void)

get a variable change

Type declaration

    • (key, oldValue, newValue, oldVariables, newVariables): void
    • Parameters

      • key: nutVariablesNames

        the key

      • oldValue: string

        the old value of the variable

      • newValue: string

        the new value of the variable

      • oldVariables: Partial<Record<nutVariablesNames, string>>

        the old variables

      • newVariables: Partial<Record<nutVariablesNames, string>>

        the new variables

      Returns void

VARIABLES_CHANGED: ((oldVariables: Partial<Record<nutVariablesNames, string>>, newVariables: Partial<Record<nutVariablesNames, string>>) => void)

get all variables update

Type declaration

    • (oldVariables, newVariables): void
    • Parameters

      Returns void