Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Private _authenticated

_authenticated: boolean = false

Private _connection

_connection: ElkConnection

Private _state

_state: ElkClientState = ElkClientState.Disconnected

options

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

authenticated

  • get authenticated(): boolean
  • True if the currently authenticated; otherwise, false.

    Returns boolean

connection

defaultTimeout

  • get defaultTimeout(): number

isConnected

  • get isConnected(): boolean

isReady

  • get isReady(): boolean
  • True if the client is in a ready state and is able to communicate with the Elk M1.

    Returns boolean

state

Methods

activateTask

  • activateTask(taskNumber: number): Promise<void>

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

arm

  • arm(areaNumber: number, armingLevel: ArmingLevel, userCode: string): Promise<void>

changeUserCode

  • changeUserCode(userNumber: number, masterOrCurrentUserCode: string | UserCode, newUserCode: string | UserCode, areaNumbers?: number[] | undefined, changeType?: UserCodeChangeType): Promise<UserCodeChangeReply>
  • Parameters

    • userNumber: number
    • masterOrCurrentUserCode: string | UserCode
    • newUserCode: string | UserCode
    • Optional areaNumbers: number[] | undefined
    • Optional changeType: UserCodeChangeType

    Returns Promise<UserCodeChangeReply>

clearTextOnScreen

  • clearTextOnScreen(areaNumber: number, beep?: undefined | false | true): Promise<void>

connect

  • connect(timeoutMs?: number): Promise<ElkClient>
  • Attempts to connect (and authenticate, if needed) to the Elk M1. Resolves when the client become ready, or rejects if there is an error or if a ready state cannot be reached within the timeout period.

    Parameters

    • Default value timeoutMs: number = this.options.connectTimeout || DEFAULT_CONNECT_TIMEOUT

      How long to wait for the client to become ready.

    Returns Promise<ElkClient>

disarm

  • disarm(areaNumber: number, userCode: string): Promise<void>

disconnect

  • disconnect(): Promise<void>
  • Disconnects the current connection and resolves when completed.

    Returns Promise<void>

displayTextOnScreen

  • displayTextOnScreen(areaNumber: number, firstLine?: string | null, secondLine?: string | null, clearOption?: DisplayTextClearOption, beep?: undefined | false | true, timeout?: undefined | number): Promise<void>
  • Parameters

    • areaNumber: number
    • Optional firstLine: string | null
    • Optional secondLine: string | null
    • Optional clearOption: DisplayTextClearOption
    • Optional beep: undefined | false | true
    • Optional timeout: undefined | number

    Returns Promise<void>

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

getAlarmsByZone

  • getAlarmsByZone(): Promise<AlarmByZoneReport>

getArmingStatus

  • getArmingStatus(): Promise<ArmingStatusReport>

getAudioData

  • getAudioData(zoneNumber: number): Promise<AudioDataReply>

getControlOutputStatus

  • getControlOutputStatus(): Promise<ControlOutputStatusReport>

getCounterValue

  • getCounterValue(counterNumber: number): Promise<CounterValueReply>

getCustomValue

  • getCustomValue(valueNumber: number): Promise<CustomValueReply>

getCustomValues

  • getCustomValues(): Promise<CustomValueReply>

getDescription

  • getDescription(textType: TextDescriptionType, address: number): Promise<TextDescriptionReply>

getInsteonLightingDeviceStatus

  • getInsteonLightingDeviceStatus(startingDeviceNumber: number, deviceCount: number): Promise<InsteonLightingDeviceStatusReply>

getKeypadAreaAssignments

  • getKeypadAreaAssignments(): Promise<KeypadAreaAssignments>

getKeypadFunctionKeyStatus

  • getKeypadFunctionKeyStatus(keypadNumber: number): Promise<KeypadKeyChange>

getLightingDeviceStatus

  • getLightingDeviceStatus(lightingDeviceNumber: number): Promise<LightingDeviceDataReply>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getOmnistat2Data

  • getOmnistat2Data(onmistatData: string): Promise<Omnistat2Reply>

getPlcStatus

  • getPlcStatus(bank: number): Promise<PlcDeviceStatusReply>

getRealTimeClock

  • getRealTimeClock(): Promise<RealTimeClockDataReply>

getSystemLogData

  • getSystemLogData(logIndex: number): Promise<SystemLogDataUpdate>

getTemperature

  • getTemperature(deviceType: TemperatureDeviceType, deviceNumber: number): Promise<TemperatureReply>

getTemperatureData

  • getTemperatureData(): Promise<TemperatureData>

getThermostatData

  • getThermostatData(thermostatNumber: number): Promise<ThermostatData>

getTroubleStatus

  • getTroubleStatus(): Promise<SystemTroubleStatusReply>

getValidUserCodeAreas

  • getValidUserCodeAreas(userCode: string): Promise<UserCodeAreasReply>

getVersionNumber

  • getVersionNumber(): Promise<VersionNumberReply>

getZoneDefinitions

  • getZoneDefinitions(): Promise<ZoneDefinitionData>

getZonePartitions

  • getZonePartitions(): Promise<ZonePartitionReport>

getZoneStatus

  • getZoneStatus(): Promise<ZoneStatusReport>

getZoneVoltage

  • getZoneVoltage(zoneNumber: number): Promise<ZoneVoltageData>

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

Private onConnectionConnected

  • onConnectionConnected(): Promise<void>

Private onConnectionData

  • onConnectionData(data: string): Promise<void>

Private onConnectionDisconnected

  • onConnectionDisconnected(): void

Private onConnectionDisconnecting

  • onConnectionDisconnecting(): void

Private onConnectionError

  • onConnectionError(error: Error): void

Private onReady

  • onReady(authenticated?: boolean): void
  • Parameters

    • Default value authenticated: boolean = false

    Returns void

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

pressKeypadFunctionKey

  • pressKeypadFunctionKey(keypadNumber: number, functionKey?: FunctionKey): Promise<KeypadKeyChange>

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

sendCommand

  • sendCommand(command: ElkCommand, timeoutMs?: number): Promise<undefined>

sendCommandForOk

  • sendCommandForOk(command: ElkCommand, timeoutMs?: number): Promise<ElkResponse>

sendCommandForResponse

  • sendCommandForResponse(command: ElkCommand, predicate: function, timeoutMs?: number): Promise<ElkResponse>
  • Sends a command and waits for a {@link ElkResponse}

    Parameters

    • command: ElkCommand

      The command to send

    • predicate: function

      A predicate function that is called for every response that is recevied and should return true when a response matches an expected response to the command that was sent.

        • (response: ElkResponse): boolean
        • Parameters

          • response: ElkResponse

          Returns boolean

    • Default value timeoutMs: number = this.defaultTimeout

    Returns Promise<ElkResponse>

sendCommandForResponseType

  • sendCommandForResponseType<T>(command: ElkCommand, ResponseClass: Function): Promise<T>
  • Helper method for sending a command and waiting for a response that matches the type of response class given.

    Useful for commands that only need to check the type of response message, and not any of it's underlying data.

    Type parameters

    • T: ElkResponse

    Parameters

    • command: ElkCommand
    • ResponseClass: Function

    Returns Promise<T>

setControlOutputOff

  • setControlOutputOff(outputNUmber: number): Promise<void>

setControlOutputOn

  • setControlOutputOn(outputNUmber: number): Promise<void>

setCounterValue

  • setCounterValue(counterNumber: number, value: number): Promise<CounterValueReply>

setCustomValue

  • setCustomValue(valueNumber: number, value: CustomValue): Promise<CustomValueReply>

setInsteaonLightingDevice

  • setInsteaonLightingDevice(startingDeviceNumber: number, deviceIds: string[]): Promise<InsteonLightingDeviceProgrammed>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setPlcDevice

  • setPlcDevice(houseCode: string, unitCode: number, functionCode: PlcFunctionCode, extendedCode: number, onTime: number): Promise<void>

setPlcDeviceOff

  • setPlcDeviceOff(houseCode: string, unitCode: number): Promise<void>

setPlcDeviceOn

  • setPlcDeviceOn(houseCode: string, unitCode: number): Promise<void>

setRealTimeClock

  • setRealTimeClock(year: number, month: MonthOfYear, day: number, dayOfWeek: DayOfWeek, hour: number, minutes: number, seconds: number): Promise<RealTimeClockDataReply>

setThermostat

  • setThermostat(thermostatNumber: number, value: number, element: ThermostatSetType): Promise<ThermostatData>

setThermostatCoolSetPoint

  • setThermostatCoolSetPoint(thermostatNumber: number, temperature: number): Promise<ThermostatData>

setThermostatFan

  • setThermostatFan(thermostatNumber: number, on: boolean): Promise<ThermostatData>

setThermostatHeatSetPoint

  • setThermostatHeatSetPoint(thermostatNumber: number, temperature: number): Promise<ThermostatData>

setThermostatHold

  • setThermostatHold(thermostatNumber: number, on: boolean): Promise<ThermostatData>

setThermostatMode

  • setThermostatMode(thermostatNumber: number, mode: ThermostatMode): Promise<ThermostatData>

speakPhrase

  • speakPhrase(phraseNumber: number): Promise<void>

speakWord

  • speakWord(wordNumber: number): Promise<void>

toggleBypassForArea

  • toggleBypassForArea(pinCode: string, areaNumber: number): Promise<ZoneBypassReply>

toggleBypassForZone

  • toggleBypassForZone(pinCode: string, zoneNumber: number): Promise<ZoneBypassReply>

toggleControlOutput

  • toggleControlOutput(outputNumber: number): Promise<void>

togglePlcDevice

  • togglePlcDevice(houseCode: string, unitCode: number): Promise<void>

triggerZone

  • triggerZone(zoneNumber: number): Promise<void>

waitForOk

  • waitForOk(timeoutMs?: number): Promise<ElkResponse>
  • Waits for an "OK" response and resolves when it is found, or rejects if it is not found within the timeout time.

    Parameters

    • Default value timeoutMs: number = this.defaultTimeout

    Returns Promise<ElkResponse>

waitForResponse

  • waitForResponse(predicate: function, timeoutMs?: number): Promise<ElkResponse>
  • Waits for a response that matches the predicate provided and resolves when it is found, or rejects if it is not found within the timeframe.

    Parameters

    • predicate: function
        • (response: ElkResponse): boolean
        • Parameters

          • response: ElkResponse

          Returns boolean

    • Default value timeoutMs: number = this.defaultTimeout

    Returns Promise<ElkResponse>

writeSystemLogData

  • writeSystemLogData(logType: LogWriteType, eventType: number, zoneNumber: number, areaNumber: number): Promise<ElkResponse>

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc