Constructors
constructor
- new NUTClient(host, port?): NUTClient
Parameters
- host: string
- port: number = 3493
Methods
connect
- connect(username, password): Promise<void>
Parameters
- username: string
- password: string
Returns Promise<void>
getCommandDescription
- getCommandDescription(ups, command): Promise<string>
Parameters
- ups: string
- command: string
Returns Promise<string>
getNumLogins
- getNumLogins(ups): Promise<number>
Returns Promise<number>
getUPS
- getUPS(name): Promise<undefined | UPS>
Returns Promise<undefined | UPS>
getVariable
- getVariable(ups, variable): Promise<string>
Returns Promise<string>
getVariableDescription
- getVariableDescription(ups, variable): Promise<string>
Returns Promise<string>
getVariableEnum
- getVariableEnum(ups, variable): Promise<string[]>
Returns Promise<string[]>
getVariableRange
- getVariableRange(ups, variable): Promise<string[]>
Returns Promise<string[]>
getVariableType
- getVariableType(ups, variable): Promise<{
type:
| "RW"
| "ENUM"
| "STRING"
| "RANGE"
| "NUMBER";
} & Record<string, unknown>> Returns Promise<{
type:
| "RW"
| "ENUM"
| "STRING"
| "RANGE"
| "NUMBER";
} & Record<string, unknown>>
help
- help(): Promise<string>
Returns Promise<string>
listClients
- listClients(ups): Promise<string[]>
Returns Promise<string[]>
listCommands
- listCommands(ups): Promise<string[]>
Returns Promise<string[]>
listUPS
- listUPS(): Promise<UPS[]>
Returns Promise<UPS[]>
listWriteableVariables
- listWriteableVariables(ups): Promise<Record<string, string>>
Returns Promise<Record<string, string>>
login
- login(ups): Promise<string>
Returns Promise<string>
logout
- logout(): Promise<string>
Returns Promise<string>
netVersion
- netVersion(): Promise<string>
Returns Promise<string>
send
- send(cmd, timeout?): Promise<string>
Parameters
- cmd: string[]
Optional
timeout: number
Returns Promise<string>
setVariable
- setVariable(ups, variable, value): Promise<string>
Returns Promise<string>
startTLS
- startTLS(...args): Promise<void>
Parameters
Rest
...args: [tlsOptions?: Omit<ConnectionOptions, "socket" | "host" | "port">]
Returns Promise<void>
version
- version(): Promise<string>
Returns Promise<string>
Allow to authenticate user on the UPS