Options
All
  • Public
  • Public/Protected
  • All
Menu

An abstract client implementation of sending/receiving specific messages from the Elk M1.

This is just a way to declutter the client and separate out the specific command implementations.

Hierarchy

Implements

Index

Properties

Abstract defaultTimeout

defaultTimeout: number

Static defaultMaxListeners

defaultMaxListeners: number

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>

disarm

  • disarm(areaNumber: number, userCode: string): 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>
  • Parameters

    • startingDeviceNumber: number
    • deviceCount: number

    Returns 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>
  • Parameters

    • deviceType: TemperatureDeviceType
    • deviceNumber: number

    Returns 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

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>
  • Parameters

    • keypadNumber: number
    • Default value functionKey: FunctionKey = FunctionKey.None

    Returns 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

Abstract sendCommand

  • sendCommand(command: ElkCommand, timeout?: undefined | number): Promise<void>

sendCommandForOk

  • sendCommandForOk(command: ElkCommand, timeoutMs?: number): Promise<ElkResponse>
  • Helper method for sending a command and waiting for an "OK" response.

    Parameters

    • command: ElkCommand
    • Default value timeoutMs: number = this.defaultTimeout

    Returns 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>
  • Parameters

    • startingDeviceNumber: number
    • deviceIds: string[]

    Returns 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>
  • Parameters

    • houseCode: string
    • unitCode: number
    • functionCode: PlcFunctionCode
    • extendedCode: number
    • onTime: number

    Returns 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>
  • Parameters

    • year: number
    • month: MonthOfYear
    • day: number
    • dayOfWeek: DayOfWeek
    • hour: number
    • minutes: number
    • seconds: number

    Returns Promise<RealTimeClockDataReply>

setThermostat

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

    • thermostatNumber: number
    • value: number
    • element: ThermostatSetType

    Returns 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>
  • Parameters

    • logType: LogWriteType
    • eventType: number
    • zoneNumber: number
    • areaNumber: number

    Returns 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