{"version":3,"sources":["jsdelivr-header.js","/npm/elk-message@1.1.0/src/enums/AlarmState.ts","/npm/elk-message@1.1.0/src/enums/ArmUpState.ts","/npm/elk-message@1.1.0/src/enums/ArmingLevel.ts","/npm/elk-message@1.1.0/src/enums/AudioCommand.ts","/npm/elk-message@1.1.0/src/enums/BeepAndChimeMode.ts","/npm/elk-message@1.1.0/src/enums/ChimeMode.ts","/npm/elk-message@1.1.0/src/enums/CustomValueFormat.ts","/npm/elk-message@1.1.0/src/enums/DayOfWeek.ts","/npm/elk-message@1.1.0/src/enums/DisplayTextClearOption.ts","/npm/elk-message@1.1.0/src/enums/EventType.ts","/npm/elk-message@1.1.0/src/enums/FunctionKey.ts","/npm/elk-message@1.1.0/src/enums/IlluminationStatus.ts","/npm/elk-message@1.1.0/src/enums/KeypadKey.ts","/npm/elk-message@1.1.0/src/enums/LogWriteType.ts","/npm/elk-message@1.1.0/src/enums/MonthOfYear.ts","/npm/elk-message@1.1.0/src/enums/PartyMode.ts","/npm/elk-message@1.1.0/src/enums/PlcFunctionCode.ts","/npm/elk-message@1.1.0/src/enums/SystemTroubleType.ts","/npm/elk-message@1.1.0/src/enums/TemperatureDeviceType.ts","/npm/elk-message@1.1.0/src/enums/TextDescriptionType.ts","/npm/elk-message@1.1.0/src/enums/ThermostatMode.ts","/npm/elk-message@1.1.0/src/enums/ThermostatSetType.ts","/npm/elk-message@1.1.0/src/enums/UserCodeChangeType.ts","/npm/elk-message@1.1.0/src/enums/UserCodeType.ts","/npm/elk-message@1.1.0/src/enums/ZoneDefinition.ts","/npm/elk-message@1.1.0/src/enums/ZoneLogicalState.ts","/npm/elk-message@1.1.0/src/enums/ZonePhysicalState.ts","/npm/elk-message@1.1.0/src/messages/constants.ts","/npm/elk-message@1.1.0/src/util/numberToHex.ts","/npm/elk-message@1.1.0/src/util/calculateChecksum.ts","/npm/elk-message@1.1.0/src/messages/responses/ElkResponse.ts","/npm/elk-message@1.1.0/src/messages/responses/UnknownElkResponse.ts","/npm/elk-message@1.1.0/src/models/AreaArmingStatus.ts","/npm/elk-message@1.1.0/src/messages/responses/ArmingStatusReport.ts","/npm/elk-message@1.1.0/src/messages/responses/SendASCIIStringToIPAddress.ts","/npm/elk-message@1.1.0/src/messages/responses/AlarmReport.ts","/npm/elk-message@1.1.0/src/messages/responses/AlarmReportTest.ts","/npm/elk-message@1.1.0/src/messages/responses/EthernetModuleTest.ts","/npm/elk-message@1.1.0/src/messages/responses/AlarmByZoneReport.ts","/npm/elk-message@1.1.0/src/messages/responses/AudioDataReply.ts","/npm/elk-message@1.1.0/src/messages/responses/OutputChangeUpdate.ts","/npm/elk-message@1.1.0/src/messages/responses/AudioCommandOutgoing.ts","/npm/elk-message@1.1.0/src/messages/responses/ControlOutputStatusReport.ts","/npm/elk-message@1.1.0/src/models/CustomTimeOfDayValue.ts","/npm/elk-message@1.1.0/src/models/CustomNumberValue.ts","/npm/elk-message@1.1.0/src/messages/responses/CustomValueReply.ts","/npm/elk-message@1.1.0/src/messages/responses/UserCodeChangeReply.ts","/npm/elk-message@1.1.0/src/messages/responses/CounterValueReply.ts","/npm/elk-message@1.1.0/src/messages/responses/LightingDeviceDataReply.ts","/npm/elk-message@1.1.0/src/messages/responses/EntryExitTimer.ts","/npm/elk-message@1.1.0/src/messages/responses/EmailSendTrigger.ts","/npm/elk-message@1.1.0/src/models/UserCode.ts","/npm/elk-message@1.1.0/src/messages/responses/UserCodeEntry.ts","/npm/elk-message@1.1.0/src/messages/responses/InstallerModeExited.ts","/npm/elk-message@1.1.0/src/messages/responses/InsteonLightingDeviceStatusReply.ts","/npm/elk-message@1.1.0/src/messages/responses/KeypadAreaAssignments.ts","/npm/elk-message@1.1.0/src/messages/responses/KeypadKeyChange.ts","/npm/elk-message@1.1.0/src/messages/responses/KeypadFunctionKeyPressReply.ts","/npm/elk-message@1.1.0/src/messages/responses/SystemLogDataUpdate.ts","/npm/elk-message@1.1.0/src/messages/responses/TemperatureData.ts","/npm/elk-message@1.1.0/src/messages/responses/PlcChangeUpdate.ts","/npm/elk-message@1.1.0/src/messages/responses/PlcDeviceStatusReply.ts","/npm/elk-message@1.1.0/src/messages/responses/EthernetModuleReset.ts","/npm/elk-message@1.1.0/src/messages/responses/ElkRPConnected.ts","/npm/elk-message@1.1.0/src/messages/responses/RealTimeClockDataReply.ts","/npm/elk-message@1.1.0/src/messages/responses/TextDescriptionReply.ts","/npm/elk-message@1.1.0/src/messages/responses/SystemTroubleStatusReply.ts","/npm/elk-message@1.1.0/src/messages/responses/TemperatureReply.ts","/npm/elk-message@1.1.0/src/messages/responses/TaskChangeUpdate.ts","/npm/elk-message@1.1.0/src/messages/responses/ThermostatData.ts","/npm/elk-message@1.1.0/src/messages/responses/Omnistat2Reply.ts","/npm/elk-message@1.1.0/src/messages/responses/VersionNumberReply.ts","/npm/elk-message@1.1.0/src/messages/responses/UserCodeAreasReply.ts","/npm/elk-message@1.1.0/src/messages/responses/AlarmMemoryUpdate.ts","/npm/elk-message@1.1.0/src/models/ZoneStatus.ts","/npm/elk-message@1.1.0/src/messages/responses/ZoneChangeUpdate.ts","/npm/elk-message@1.1.0/src/messages/responses/ZoneBypassReply.ts","/npm/elk-message@1.1.0/src/messages/responses/ZonePartitionReport.ts","/npm/elk-message@1.1.0/src/messages/responses/ZoneStatusReport.ts","/npm/elk-message@1.1.0/src/messages/responses/ZoneDefinitionData.ts","/npm/elk-message@1.1.0/src/messages/responses/ZoneVoltageData.ts","/npm/elk-message@1.1.0/src/messages/responses/InsteonLightingDeviceProgrammed.ts","/npm/elk-message@1.1.0/src/messages/parse.ts","/npm/elk-message@1.1.0/src/messages/commands/ElkCommand.ts","/npm/elk-message@1.1.0/src/messages/commands/AlarmByZoneRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/AlarmReportAcknowledge.ts","/npm/elk-message@1.1.0/src/messages/commands/AlarmReportTestAcknowledge.ts","/npm/elk-message@1.1.0/src/messages/commands/Arm.ts","/npm/elk-message@1.1.0/src/messages/commands/ArmingStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/AudioCommandIncoming.ts","/npm/elk-message@1.1.0/src/messages/commands/AudioDataRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ControlOutputOff.ts","/npm/elk-message@1.1.0/src/messages/commands/ControlOutputOn.ts","/npm/elk-message@1.1.0/src/messages/commands/ControlOutputStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ControlOutputToggle.ts","/npm/elk-message@1.1.0/src/messages/commands/CounterValueRead.ts","/npm/elk-message@1.1.0/src/messages/commands/CounterValueWrite.ts","/npm/elk-message@1.1.0/src/messages/commands/CustomValueRead.ts","/npm/elk-message@1.1.0/src/messages/commands/CustomValueWrite.ts","/npm/elk-message@1.1.0/src/messages/commands/CustomValuesReadAll.ts","/npm/elk-message@1.1.0/src/messages/commands/DisplayTextOnScreen.ts","/npm/elk-message@1.1.0/src/messages/commands/EthernetModuleTestAcknowledge.ts","/npm/elk-message@1.1.0/src/messages/commands/InsteonLightingDeviceProgramRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/InsteonLightingDeviceStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/KeypadAreaAssigmentsRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/KeypadFunctionKeyPressRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/KeypadFunctionKeyStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/LightingDeviceStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/Omnistat2Request.ts","/npm/elk-message@1.1.0/src/messages/commands/PlcDeviceControl.ts","/npm/elk-message@1.1.0/src/messages/commands/PlcDeviceOff.ts","/npm/elk-message@1.1.0/src/messages/commands/PlcDeviceOn.ts","/npm/elk-message@1.1.0/src/messages/commands/PlcDeviceStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/PlcDeviceToggle.ts","/npm/elk-message@1.1.0/src/messages/commands/RealTimeClockDataRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/RealTimeClockDataWrite.ts","/npm/elk-message@1.1.0/src/messages/commands/SpeakPhrase.ts","/npm/elk-message@1.1.0/src/messages/commands/SpeakWord.ts","/npm/elk-message@1.1.0/src/messages/commands/SystemLogDataReadRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/SystemLogDataWriteRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/SystemTroubleStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/TaskActivation.ts","/npm/elk-message@1.1.0/src/messages/commands/TemperatureDataRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/TemperatureRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/TextDescriptionRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ThermostatDataRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ThermostatSet.ts","/npm/elk-message@1.1.0/src/messages/commands/ThermostatSetCoolSetPoint.ts","/npm/elk-message@1.1.0/src/messages/commands/ThermostatSetFan.ts","/npm/elk-message@1.1.0/src/messages/commands/ThermostatSetHeatSetPoint.ts","/npm/elk-message@1.1.0/src/messages/commands/ThermostatSetHold.ts","/npm/elk-message@1.1.0/src/messages/commands/ThermostatSetMode.ts","/npm/elk-message@1.1.0/src/messages/commands/UserCodeAreasRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/UserCodeChangeRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/VersionNumberRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ZoneBypassRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ZoneDefinitionRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ZonePartitionRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ZoneStatusRequest.ts","/npm/elk-message@1.1.0/src/messages/commands/ZoneTrigger.ts","/npm/elk-message@1.1.0/src/messages/commands/ZoneVoltageRequest.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,wMCNA,IAAK,GAAL,SAAK,GACH,IAAA,gBACA,IAAA,8CACA,IAAA,kDAC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: /npm/elk-message@1.1.0/dist/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","enum AlarmState {\n  None = 48, // '0'\n  EntranceDelayActive = 49, // '1'\n  AlarmAbortDelayActive = 50, // '2'\n  FireAlarm = 51, // '3'\n  MedicalAlarm = 52, // '4'\n  PoliceAlarm = 53, // '5'\n  BurglarAlarm = 54, // '6'\n  Aux1Alarm = 55, // '7'\n  Aux2Alarm = 56, // '8'\n  Aux3Alarm = 57, // '9'\n  Aux4Alarm = 58, // ':'\n  CarbonMonoxideAlarm = 59, // ';'\n  EmergencyAlarm = 60, // '<'\n  FreezeAlarm = 61, // '='\n  GasAlarm = 62, // '>'\n  HeatAlarm = 63, // '?'\n  WaterAlarm = 64, // '@'\n  FireSupervisory = 65, // 'A'\n  VerifyFire = 66 // 'B'\n}\n\nnamespace AlarmState {\n  /**\n   * Determines if an AlarmState value indicates an active alarm\n   * @param alarmState The AlarmState to check\n   * @returns {boolean} True if the value is an active alarm;\n   *   Otherwise, false.\n   */\n  export function isActiveAlarm(alarmState: AlarmState) {\n    // tslint:disable-next-line:no-unnecessary-qualifier\n    return alarmState > AlarmState.AlarmAbortDelayActive;\n  }\n}\n\nexport default AlarmState;\n","enum ArmUpState {\n  NotReadyToArm = 48, // '0',\n  ReadyToArm = 49, // '1',\n  ReadyToArmForced = 50, // '2',\n  ArmedTimer = 51, // '3',\n  ArmedFully = 52, // '4',\n  ForceArmed = 53, // '5',\n  ArmedWithBypass = 54 // '6',\n}\n\nexport default ArmUpState;\n","enum ArmingLevel {\n  Disarm = 48, // '0',\n  ArmedAway = 49, // '1',\n  ArmedStay = 50, // '2',\n  ArmedStayInstant = 51, // '3',\n  ArmedNight = 52, // '4',\n  ArmedNightInstant = 53, // '5',\n  ArmedVacation = 54, // '6',\n  ArmToNextAwayMode = 55, // '7', // Version 4.2.8 or later\n  ArmToNextStayMode = 56, // '8', // Version 4.2.8 or later\n  ForceArmToAwayMode = 57, // '9', // Version 5.3.0 or later\n  ForceArmToStayMode = 58 // ':', // Version 5.3.0 or later\n}\n\n/* tslint:disable:no-unnecessary-qualifier */\nnamespace ArmingLevel {\n  export const AWAY_LEVELS = [\n    ArmingLevel.ArmedAway,\n    ArmingLevel.ArmedVacation,\n    ArmingLevel.ArmToNextAwayMode,\n    ArmingLevel.ForceArmToAwayMode\n  ];\n\n  export const NIGHT_LEVELS: ReadonlyArray<ArmingLevel> = [\n    ArmingLevel.ArmedNight,\n    ArmingLevel.ArmedNightInstant\n  ];\n\n  export const STAY_LEVELS: ReadonlyArray<ArmingLevel> = [\n    ...NIGHT_LEVELS,\n    ArmingLevel.ArmedStay,\n    ArmingLevel.ArmedStayInstant,\n    ArmingLevel.ArmToNextStayMode,\n    ArmingLevel.ForceArmToStayMode\n  ];\n\n  export const INSTANT_LEVELS: ReadonlyArray<ArmingLevel> = [\n    ArmingLevel.ArmedStayInstant,\n    ArmingLevel.ArmedNightInstant\n  ];\n\n  export const FORCE_LEVELS: ReadonlyArray<ArmingLevel> = [\n    ArmingLevel.ForceArmToAwayMode,\n    ArmingLevel.ForceArmToStayMode\n  ];\n\n  export const VACATION_LEVELS: ReadonlyArray<ArmingLevel> = [ArmingLevel.ArmedVacation];\n\n  export function isAway(armingLevel: ArmingLevel) {\n    return AWAY_LEVELS.includes(armingLevel);\n  }\n\n  export function isNight(armingLevel: ArmingLevel) {\n    return NIGHT_LEVELS.includes(armingLevel);\n  }\n\n  export function isStay(armingLevel: ArmingLevel) {\n    return STAY_LEVELS.includes(armingLevel);\n  }\n\n  export function isInstant(armingLevel: ArmingLevel) {\n    return INSTANT_LEVELS.includes(armingLevel);\n  }\n\n  export function isForce(armingLevel: ArmingLevel) {\n    return FORCE_LEVELS.includes(armingLevel);\n  }\n\n  export function isVacation(armingLevel: ArmingLevel) {\n    return VACATION_LEVELS.includes(armingLevel);\n  }\n}\n\nexport default ArmingLevel;\n","enum AudioCommand {\n  PowerOff = 0,\n  PowerOn = 1,\n  PowerToggle = 2,\n  NextSource = 3,\n  Source = 4,\n  PreviousSelect = 5,\n  NextSelect = 6,\n  VolumeDown = 7,\n  VolumeUp = 8,\n  MuteAudio = 9,\n  VolumeSet = 10,\n  Play = 11,\n  Pause = 12,\n  Stop = 13,\n  SelectFavorite1 = 14,\n  SelectFavorite2 = 15,\n  Minus = 16,\n  Plus = 17,\n  AllZonesOff = 18,\n  AllZonesOn = 19,\n  AudioSystemManufacturer = 20\n}\n\nexport default AudioCommand;\n","enum BeepAndChimeMode {\n  Off = 48, // '0'\n  Single = 49, // '1'\n  Constant = 50, // '2'\n  Chime = 52 // '4'\n}\n\nexport default BeepAndChimeMode;\n","enum ChimeMode {\n  Off = 48, // '0'\n  Chime = 49, // '1'\n  Voice = 50, // '2'\n  ChimeAndVoice = 51 // '3'\n}\n\nexport default ChimeMode;\n","enum CustomValueFormat {\n  Number = 0,\n  Timer = 1,\n  TimeOfDay = 2\n}\n\nexport default CustomValueFormat;\n","enum DayOfWeek {\n  Sunday = 1,\n  Monday = 2,\n  Tuesday = 3,\n  Wednesday = 4,\n  Thursday = 5,\n  Friday = 6,\n  Saturday = 7\n}\n\nnamespace DayOfWeek {\n  export function isWeekend(dayOfWeek: DayOfWeek) {\n    // tslint:disable-next-line:no-unnecessary-qualifier\n    return dayOfWeek === DayOfWeek.Saturday || dayOfWeek === DayOfWeek.Sunday;\n  }\n\n  export function isWeekday(dayOfWeek: DayOfWeek) {\n    return !isWeekend(dayOfWeek);\n  }\n}\n\nexport default DayOfWeek;\n","enum DisplayTextClearOption {\n  Clear = 0,\n  ClearWithStarKey = 1,\n  DisplayUntilTimeout = 2\n}\n\nexport default DisplayTextClearOption;\n","enum EventType {\n  NoEvent = 1000,\n  FireALarm = 1001,\n  FireSupervisoryAlarm = 1002,\n  BurglarAlarmAnyArea = 1003,\n  MedicalAlarmAnyArea = 1004,\n  PoliceAlarmAnyArea = 1005,\n  Aux1_24HourAlarmAnyArea = 1006,\n  Aux2_24HourAlarmAnyArea = 1007,\n  CarbonMonoxideAlarmAnyArea = 1008,\n  EmergencyAlarmAnyArea = 1009,\n  FreezeAlarmAnyArea = 1010,\n  GasAlarmAnyArea = 1011,\n  HeatAlarmAnyArea = 1012,\n  WaterAlarmAnyArea = 1013,\n  AlarmAnyArea = 1014,\n\n  BurglarAlarmArea1 = 1015,\n  BurglarAlarmArea2 = 1016,\n  BurglarAlarmArea3 = 1017,\n  BurglarAlarmArea4 = 1018,\n  BurglarAlarmArea5 = 1019,\n  BurglarAlarmArea6 = 1020,\n  BurglarAlarmArea7 = 1021,\n  BurglarAlarmArea8 = 1022,\n\n  MedicalAlarmArea1 = 1023,\n  MedicalAlarmArea2 = 1024,\n  MedicalAlarmArea3 = 1025,\n  MedicalAlarmArea4 = 1026,\n  MedicalAlarmArea5 = 1027,\n  MedicalAlarmArea6 = 1028,\n  MedicalAlarmArea7 = 1029,\n  MedicalAlarmArea8 = 1030,\n\n  PoliceAlarmArea1 = 1031,\n  PoliceAlarmArea2 = 1032,\n  PoliceAlarmArea3 = 1033,\n  PoliceAlarmArea4 = 1034,\n  PoliceAlarmArea5 = 1035,\n  PoliceAlarmArea6 = 1036,\n  PoliceAlarmArea7 = 1037,\n  PoliceAlarmArea8 = 1038,\n\n  Aux1_24HourAlarmArea1 = 1039,\n  Aux1_24HourAlarmArea2 = 1040,\n  Aux1_24HourAlarmArea3 = 1041,\n  Aux1_24HourAlarmArea4 = 1042,\n  Aux1_24HourAlarmArea5 = 1043,\n  Aux1_24HourAlarmArea6 = 1044,\n  Aux1_24HourAlarmArea7 = 1045,\n  Aux1_24HourAlarmArea8 = 1046,\n\n  Aux2_24HourAlarmArea1 = 1047,\n  Aux2_24HourAlarmArea2 = 1048,\n  Aux2_24HourAlarmArea3 = 1049,\n  Aux2_24HourAlarmArea4 = 1050,\n  Aux2_24HourAlarmArea5 = 1051,\n  Aux2_24HourAlarmArea6 = 1052,\n  Aux2_24HourAlarmArea7 = 1053,\n  Aux2_24HourAlarmArea8 = 1054,\n\n  CarbonMonoxideAlarmArea1 = 1055,\n  CarbonMonoxideAlarmArea2 = 1056,\n  CarbonMonoxideAlarmArea3 = 1057,\n  CarbonMonoxideAlarmArea4 = 1058,\n  CarbonMonoxideAlarmArea5 = 1059,\n  CarbonMonoxideAlarmArea6 = 1060,\n  CarbonMonoxideAlarmArea7 = 1061,\n  CarbonMonoxideAlarmArea8 = 1062,\n\n  EmergencyAlarmArea1 = 1063,\n  EmergencyAlarmArea2 = 1064,\n  EmergencyAlarmArea3 = 1065,\n  EmergencyAlarmArea4 = 1066,\n  EmergencyAlarmArea5 = 1067,\n  EmergencyAlarmArea6 = 1068,\n  EmergencyAlarmArea7 = 1069,\n  EmergencyAlarmArea8 = 1070,\n\n  FreezeAlarmArea1 = 1071,\n  FreezeAlarmArea2 = 1072,\n  FreezeAlarmArea3 = 1073,\n  FreezeAlarmArea4 = 1074,\n  FreezeAlarmArea5 = 1075,\n  FreezeAlarmArea6 = 1076,\n  FreezeAlarmArea7 = 1077,\n  FreezeAlarmArea8 = 1078,\n\n  GasAlarmArea1 = 1079,\n  GasAlarmArea2 = 1080,\n  GasAlarmArea3 = 1081,\n  GasAlarmArea4 = 1082,\n  GasAlarmArea5 = 1083,\n  GasAlarmArea6 = 1084,\n  GasAlarmArea7 = 1085,\n  GasAlarmArea8 = 1086,\n\n  HeatAlarmArea1 = 1087,\n  HeatAlarmArea2 = 1088,\n  HeatAlarmArea3 = 1089,\n  HeatAlarmArea4 = 1090,\n  HeatAlarmArea5 = 1091,\n  HeatAlarmArea6 = 1092,\n  HeatAlarmArea7 = 1093,\n  HeatAlarmArea8 = 1094,\n\n  WaterAlarmArea1 = 1095,\n  WaterAlarmArea2 = 1096,\n  WaterAlarmArea3 = 1097,\n  WaterAlarmArea4 = 1098,\n  WaterAlarmArea5 = 1099,\n  WaterAlarmArea6 = 1100,\n  WaterAlarmArea7 = 1101,\n  WaterAlarmArea8 = 1102,\n\n  AlarmArea1 = 1103,\n  AlarmArea2 = 1104,\n  AlarmArea3 = 1105,\n  AlarmArea4 = 1106,\n  AlarmArea5 = 1107,\n  AlarmArea6 = 1108,\n  AlarmArea7 = 1109,\n  AlarmArea8 = 1110,\n\n  CodeLockout = 1111,\n  CodeLockoutKeypad1 = 1112,\n  CodeLockoutKeypad2 = 1113,\n  CodeLockoutKeypad3 = 1114,\n  CodeLockoutKeypad4 = 1115,\n  CodeLockoutKeypad5 = 1116,\n  CodeLockoutKeypad6 = 1117,\n  CodeLockoutKeypad7 = 1118,\n  CodeLockoutKeypad8 = 1119,\n  CodeLockoutKeypad9 = 1120,\n  CodeLockoutKeypad10 = 1121,\n  CodeLockoutKeypad11 = 1122,\n  CodeLockoutKeypad12 = 1123,\n  CodeLockoutKeypad13 = 1124,\n  CodeLockoutKeypad14 = 1125,\n  CodeLockoutKeypad15 = 1126,\n  CodeLockoutKeypad16 = 1127,\n\n  FireTrouble = 1128,\n  BurglarTrouble = 1129,\n  FailToCommunicateTrouble = 1130,\n  RfSensorLowBatteryTrouble = 1131,\n  LostAncModuleTrouble = 1132,\n  LostKeypadTrouble = 1133,\n  LostInputExpanderTrouble = 1134,\n  LostOutputExpanderTrouble = 1135\n}\n\nexport default EventType;\n","enum FunctionKey {\n  None = 48, // '0'\n  F1 = 49, // '1'\n  F2 = 50, // '2'\n  F3 = 51, // '3'\n  F4 = 52, // '4'\n  F5 = 53, // '5'\n  F6 = 54, // '6'\n  SilenceTroubleBeep = 42, // '*' (0x2A)\n  Chime = 67 // 'C' (0x43)\n}\n\nexport default FunctionKey;\n","enum IlluminationStatus {\n  Off = 48, // '0',\n  On = 49, // '1',\n  Blinking = 50 // '2',\n}\n\nexport default IlluminationStatus;\n","enum KeypadKey {\n  None = 0, // or a user code was sent from a keypad.\n  Star = 11, // *\n  Pound = 12, // #\n  F1 = 13,\n  F2 = 14,\n  F3 = 15,\n  F4 = 16,\n  Stay = 17,\n  Exit = 18,\n  Chime = 19,\n  Bypass = 20,\n  Elk = 21,\n  Down = 22,\n  Up = 23,\n  Right = 24,\n  Left = 25,\n  F6 = 26,\n  F7 = 27,\n  Data = 28 // Data was entered, this acts as a carriage return\n}\n\nexport default KeypadKey;\n","enum LogWriteType {\n  AlarmRestore = 64,\n  Alarm = 128\n}\n\nexport default LogWriteType;\n","enum MonthOfYear {\n  January = 1,\n  February = 2,\n  March = 3,\n  April = 4,\n  May = 5,\n  June = 6,\n  July = 7,\n  August = 8,\n  September = 9,\n  October = 10,\n  November = 11,\n  December = 12\n}\n\nexport default MonthOfYear;\n","enum PartyMode {\n  Off = 0,\n  On = 1,\n  Master = 2\n}\n\nexport default PartyMode;\n","enum PlcFunctionCode {\n  AllUnitsOff = 1,\n  AllLightsOn = 2,\n  UnitOn = 3,\n  UnitOff = 4,\n  Dim = 5,\n  Bright = 6,\n  AllLightsOff = 7,\n  ExtendedCode = 8,\n  PresetDim = 9,\n  ExtendedData = 10,\n  StatusRequest = 11,\n  HailRequest = 12,\n  HailAcknowledgement = 13,\n  StatusOn = 14,\n  StatusOff = 15\n}\n\nexport default PlcFunctionCode;\n","enum SystemTroubleType {\n  None = 0,\n  ACFail = 1 << 0,\n  BoxTamper = 1 << 1,\n  FailToCommunicate = 1 << 2,\n  EEPromMemoryError = 1 << 3,\n  LowBatteryControl = 1 << 4,\n  TransmitterLowBattery = 1 << 5,\n  OverCurrent = 1 << 6,\n  TelephoneFault = 1 << 7,\n  Output2 = 1 << 8,\n  MissingKeypad = 1 << 9,\n  ZoneExpander = 1 << 10,\n  OutputExpander = 1 << 11,\n  ELKRPRemoteAccess = 1 << 12,\n  CommonAreaNotArmed = 1 << 13,\n  FlashMemoryError = 1 << 14,\n  SecurityAlert = 1 << 15,\n  SerialPortExpander = 1 << 16,\n  LostTransmitter = 1 << 17,\n  GESmokeCleanMe = 1 << 18,\n  EthernetTrouble = 1 << 19,\n  DisplayMessageInKeypadLine1 = 1 << 20,\n  DisplayMessageInKeypadLine2 = 1 << 21,\n  FireTrouble = 1 << 22\n}\n\nexport default SystemTroubleType;\n","enum TemperatureDeviceType {\n  TemperatureProbe = 0,\n  Keypad = 1,\n  Thermostat = 2\n}\n\nexport default TemperatureDeviceType;\n","enum TextDescriptionType {\n  ZoneName = 0,\n  AreaName = 1,\n  UserName = 2,\n  KeypadName = 3,\n  OutputName = 4,\n  TaskName = 5,\n  TelephoneName = 6,\n  LightName = 7,\n  AlarmDurationName = 8,\n  CustomSettings = 9,\n  CounterName = 10,\n  ThermostatName = 11,\n  FunctionKey1Name = 12,\n  FunctionKey2Name = 13,\n  FunctionKey3Name = 14,\n  FunctionKey4Name = 15,\n  FunctionKey5Name = 16,\n  FunctionKey6Name = 17,\n  AudioZoneName = 18,\n  AudioSourceName = 19\n}\n\nexport default TextDescriptionType;\n","enum ThermostatMode {\n  Off = 48, // '0'\n  Heat = 49, // '1'\n  Cool = 50, // '2'\n  Auto = 51, // '3'\n  EmergencyHeat = 52 // '4'\n}\n\nexport default ThermostatMode;\n","enum ThermostatSetType {\n  Mode = 0,\n  Hold = 1,\n  Fan = 2,\n  Temperature = 3,\n  CoolSetPoint = 4,\n  HeatSetPoint = 5\n}\n\nexport default ThermostatSetType;\n","enum UserCodeChangeType {\n  UserCode = 0,\n  SetRestriction = 1,\n  ClearRestriction = 2\n}\n\nexport default UserCodeChangeType;\n","enum UserCodeType {\n  User = 49,\n  Master = 50,\n  Installer = 51,\n  ElkRP = 52\n}\n\nexport default UserCodeType;\n","enum ZoneDefinition {\n  Disabled = 48, // '0'\n  BurglarEntryExit1 = 49, // '1'\n  BurglarEntryExit2 = 50, // '2'\n  BurglarPerimeterInstant = 51, // '3'\n  BurglarInterior = 52, // '4'\n  BurglarInteriorFollower = 53, // '5'\n  BurglarInteriorNight = 54, // '6'\n  BurglarInteriorNightDelay = 55, // '7'\n  Burglar24Hour = 56, // '8'\n  BurglarBoxTamper = 57, // '9'\n  FireAlarm = 58, // ':'\n  FireVerified = 59, // ';'\n  FireSupervisory = 60, // '<'\n  AuxAlarm1 = 61, // '='\n  AuxAlarm2 = 62, // '>'\n  Keyfob = 63, // '?'\n  NonAlarm = 64, // '@'\n  CarbonMonoxide = 65, // 'A'\n  EmergencyAlarm = 66, // 'B'\n  FreezeAlarm = 67, // 'C'\n  GasAlarm = 68, // 'D'\n  HeatAlarm = 69, // 'E'\n  MedicalAlarm = 70, // 'F'\n  PoliceAlarm = 71, // 'G'\n  PoliceNoIndication = 72, // 'H'\n  WaterAlarm = 73, // 'I'\n  KeyMomentaryArmDisarm = 74, // 'J'\n  KeyMomentaryArmAway = 75, // 'K'\n  KeyMomentaryArmStay = 76, // 'L'\n  KeyMomentaryDisarm = 77, // 'M'\n  KeyOnOff = 78, // 'N'\n  MuteAudibles = 79, // 'O'\n  PowerSupervisory = 80, // 'P'\n  Temperature = 81, // 'Q'\n  AnalogZone = 82, // 'R'\n  PhoneKey = 83, // 'S'\n  IntercomKey = 84 // 'T'\n}\n\nexport default ZoneDefinition;\n","enum ZoneLogicalState {\n  Normal = 0,\n  Trouble = 1,\n  Violated = 2,\n  Bypassed = 3\n}\n\nexport default ZoneLogicalState;\n","enum ZonePhysicalState {\n  Unconfigured = 0,\n  Open = 1,\n  EOL = 2,\n  Short = 3\n}\n\nexport default ZonePhysicalState;\n","/**\n * The number of characters used to represent the checksum in a\n * message packet.\n * @see 4.1.6\n */\nexport const CHECKSUM_WIDTH = 2;\n\n/**\n * The number of characters used to represent the packet length in\n * a message packet.\n * @see 4.1.1\n */\nexport const PACKET_LENGTH_WIDTH = 2;\n\n/**\n * The default reserved characters for a message packet.\n * @see 4.1.5\n */\nexport const RESERVED_DEFAULT = '00';\n\n/**\n * The number of characters used to represent the reserved portion of\n * a message packet.\n * @see 4.1.5\n */\nexport const RESERVED_WIDTH = RESERVED_DEFAULT.length;\n\n/**\n * The message termination characters\n * @see 4.1.7\n */\nexport const TERMINATOR = '\\r\\n';\n","/**\n * Converts a number to it's hexadecimal notation equivalent.\n * @param value The number to convert.\n * @param width The number of characters to pad the result to.\n * @return {string} A hexidecimal string representing the number provided.\n */\nexport default function numberToHex(value: number, width: number = 2): string {\n  return value\n    .toString(16)\n    .toUpperCase()\n    .padStart(width, '0');\n}\n","import { CHECKSUM_WIDTH } from '../messages/constants';\nimport numberToHex from './numberToHex';\n\n/**\n * Returns the two's complement of a value between 0 and 255.\n * @param value The value to calculate the two's compliment for.\n * @return The two's complement of the value.\n * @throws {RAngeError} if the value is less than 0 or greater than 255.\n */\nexport function twosComplement(value: number): number {\n  if (value < 0 || value > 255) {\n    throw new RangeError('Value must be between 0 and 255');\n  }\n\n  return (value ^ 0xff) + 1;\n}\n\n/**\n * Calculates the checksum for an elk message.\n * @see {M1-RS232-ASCII-Protocol} 4.1.6\n *\n * This is the hexadecimal two’s complement of the modulo-256 sum\n * of the ASCII values of all characters in the message excluding\n * the checksum itself and the CR-LF terminator at the end of the\n * message. Permissible characters are ASCII 0-9 and upper case A-F.\n * When all the characters are added to the Checksum, the value should equal 0.\n */\nexport default function calculateChecksum(input: string) {\n  const inputBuffer = Buffer.from(input, 'ascii');\n\n  // Sum all of the ASCII values.\n  const sum = inputBuffer.reduce((accumulator, char) => accumulator + char, 0);\n\n  // Find the two's complement of the module-256 sum.\n  const checksum = twosComplement(sum % 256);\n\n  // Convert it to hex.\n  return numberToHex(checksum, CHECKSUM_WIDTH);\n}\n","import ElkMessage from '../ElkMessage';\nimport { CHECKSUM_WIDTH, PACKET_LENGTH_WIDTH, RESERVED_WIDTH, TERMINATOR } from '../constants';\nimport calculateChecksum from '../../util/calculateChecksum';\nimport numberToHex from '../../util/numberToHex';\n\n/**\n * A regex expression that parses a raw message packet and captures:\n * 1. Packet length\n * 2. Message type\n * 3. Sub-message type\n * 4. Data\n * 5. Reserved\n * 6. Checksum\n * 7. Terminator\n */\nconst PACKET_REGEX = new RegExp(\n  `^(\\\\S{${PACKET_LENGTH_WIDTH}})(\\\\S)(\\\\S)(.*)(\\\\S{${RESERVED_WIDTH}})(\\\\S{${CHECKSUM_WIDTH}})(${TERMINATOR}|${\n    TERMINATOR[0]\n  }|${TERMINATOR[1]})$`\n);\n\n/**\n * A message that is received from the Elk M1\n */\nexport default class ElkResponse implements ElkMessage {\n  readonly isWellFormed: boolean = false;\n  readonly isChecksumValid: boolean = false;\n  readonly isPacketLengthValid: boolean = false;\n\n  readonly messageType?: string;\n  readonly subMessageType?: string;\n  readonly data: string = '';\n  readonly reserved?: string;\n  readonly checksum?: string;\n  readonly terminator?: string;\n  readonly expectedChecksum?: string;\n  readonly packetLength?: string;\n  readonly expectedPacketLength?: string;\n\n  constructor(readonly raw: string) {\n    const result = PACKET_REGEX.exec(raw);\n    this.isWellFormed = !!result;\n\n    if (result) {\n      this.packetLength = result[1];\n      this.messageType = result[2];\n      this.subMessageType = result[3];\n      this.data = result[4];\n      this.reserved = result[5];\n      this.checksum = result[6];\n      this.terminator = result[7];\n\n      this.expectedPacketLength = numberToHex(\n        raw.length - PACKET_LENGTH_WIDTH - this.terminator.length,\n        PACKET_LENGTH_WIDTH\n      );\n      this.expectedChecksum = calculateChecksum(\n        raw.substring(0, raw.length - CHECKSUM_WIDTH - this.terminator.length)\n      );\n\n      this.isChecksumValid = this.checksum === this.expectedChecksum;\n      this.isPacketLengthValid = this.packetLength === this.expectedPacketLength;\n    }\n  }\n\n  get command(): string | null {\n    if (!this.messageType || !this.subMessageType) {\n      return null;\n    }\n\n    return this.messageType[0] + this.subMessageType[0];\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * A response received from the Elk M1 that is an unrecognized message.\n */\nexport default class UnknownElkResponse extends ElkResponse {}\n","import ArmingLevel from '../enums/ArmingLevel';\nimport ArmUpState from '../enums/ArmUpState';\nimport AlarmState from '../enums/AlarmState';\n\nexport default class AreaArmingStatus {\n  constructor(\n    readonly area: number,\n    readonly armingLevel: ArmingLevel,\n    readonly armUpState: ArmUpState,\n    readonly alarmState: AlarmState\n  ) {}\n}\n","import ElkResponse from './ElkResponse';\nimport ArmUpState from '../../enums/ArmUpState';\nimport AlarmState from '../../enums/AlarmState';\nimport AreaArmingStatus from '../../models/AreaArmingStatus';\n\n/**\n * A response from the Elk M1 that reports the arming status for all areas.\n *\n * If the control’s area status changes, this message will be sent if\n * Global Option “Transmit Keypad Keys” is enabled.\n *\n * May be requested by sending a {@link ArmingStatusRequest}\n *\n * @see 4.2.13 Reply Arming Status Report Data (AS)\n */\nexport default class ArmingStatusReport extends ElkResponse {\n  static readonly COMMAND = 'AS';\n\n  /**\n   * An array describing status for each area\n   * (area 1 = index 0, area 2 = index 1, etc.)\n   */\n  readonly areas: AreaArmingStatus[];\n\n  constructor(raw: string) {\n    super(raw);\n\n    const armingLevels = Array.from(this.data.substr(0, 8)).map(char => char.charCodeAt(0));\n    const armUpStates = Array.from(this.data.substr(8, 8)).map(char => char.charCodeAt(0));\n    const alarmStates = Array.from(this.data.substr(16, 8)).map(char => char.charCodeAt(0));\n\n    this.areas = [1, 2, 3, 4, 5, 6, 7, 8].map(\n      (areaNumber, index) =>\n        new AreaArmingStatus(\n          areaNumber,\n          armingLevels[index],\n          armUpStates[index],\n          alarmStates[index]\n        )\n    );\n  }\n\n  /**\n   * Gets the arming status for an area\n   * @param areaNumber The area number (1..8)\n   */\n  getAreaStatus(areaNumber: number): AreaArmingStatus {\n    return this.areas[areaNumber - 1];\n  }\n\n  /**\n   * If any area has an {@link AreaArmingStatus.armUpState} of\n   * {@link ArmUpState.ArmedTimer}, this will return the\n   * exit time in seconds; Othwerise, this returns `null`\n   */\n  get exitTime(): number | null {\n    if (\n      this.reserved &&\n      this.areas.find(areaStatus => areaStatus.armUpState === ArmUpState.ArmedTimer)\n    ) {\n      return parseInt(this.reserved, 10);\n    }\n\n    return null;\n  }\n\n  /**\n   * If any area has an {@link AreaArmingStatus.alarmState} of\n   * {@link AlarmState.EntranceDelayActive} and no areas have an\n   * {@link AreaArmingStatus.armUpState} of {@link ArmUpState.ArmedTimer},\n   * this will return the entrance time in seconds; Othwerise, this\n   * returns `null`.\n   */\n  get entranceTime(): number | null {\n    if (\n      this.reserved &&\n      this.exitTime === null &&\n      this.areas.find(areaStatus => areaStatus.alarmState === AlarmState.EntranceDelayActive)\n    ) {\n      return parseInt(this.reserved, 10);\n    }\n\n    return null;\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Send ASCII String To IP Address\n *\n * It is recommended this response NOT be used.\n *\n * The documentation on this particular \"command\" is very confusing.\n * Upper-cased commands are supposed to be responses from the M1,\n * but the documentation for this reads as those it's a command that\n * can be sent TO the panel. The example include message packets\n * which aren't even valid (they don't have checksums, the reserved\n * values, and the terminator).\n *\n * So I'm not entirely sure how this is supposed to be implemented.\n * For now it does some minimal parsing as a response message.\n *\n * TODO: Implement correctly?\n *\n * @see 4.3 Send ASCII String To IP Address (AP)\n */\nexport default class SendASCIIStringToIPAddress extends ElkResponse {\n  static readonly COMMAND = 'AP';\n\n  readonly ipAddressNumber: number;\n  readonly textData: string;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.ipAddressNumber = parseInt(this.data.substr(0, 1), 10);\n    this.textData = this.data.substr(1);\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reports an alarm\n *\n * Reporting of alarms through the built on serial port 0 consists of an\n * ASCII string following the same data format of the digital dialer’s\n * Contact ID transmission. Programming one of the telephone numbers with\n * a dialer format set to “Ethernet” will enable the transmissions of the\n * alarm ASCII strings over the RS-232 serial port 0.\n * Available in M1 Version 4.2.8 and after.\n *\n * @see 4.4.1 Alarm Reporting (AR)\n */\nexport default class AlarmReport extends ElkResponse {\n  static readonly COMMAND = 'AR';\n\n  readonly accountNumber: number;\n\n  /**\n   * Alarm code\n   */\n  readonly alarmCode: number;\n\n  /**\n   * Area number where alarm occured (1..8)\n   */\n  readonly areaNumber: number;\n\n  /**\n   * Zone/user number (1..208)\n   */\n  readonly zoneNumber: number;\n\n  /**\n   * IP Address nunber to send alarm on. Valid 1 to 8 on M1 Gold,\n   * 1 to 4 on M1 Standard and Ez8.\n   */\n  readonly ipAddressNumber: number;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.accountNumber = parseInt(this.data.substr(0, 6), 10);\n    this.alarmCode = parseInt(this.data.substr(6, 4), 10);\n    this.areaNumber = parseInt(this.data.substr(10, 2), 10);\n    this.zoneNumber = parseInt(this.data.substr(12, 3), 10);\n    this.ipAddressNumber = parseInt(this.data.substr(15, 1), 10);\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Alarm Reporting Test\n *\n * The Alarm Reporting Test string is sent every 15 minutes from the M1\n * as a keep alive message to the M1XEP Ethernet Module along with which\n * IP address to test. All IP addresses are set into the M1XEP module.\n *\n * @see 4.4.3 Alarm Reporting Test (AT)\n */\nexport default class AlarmReportTest extends ElkResponse {\n  static readonly COMMAND = 'AT';\n\n  /**\n   * IP Address to test (1..8), identified by it's configured\n   * number/index (1-based).\n   */\n  readonly ipAddressNumber: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.ipAddressNumber = parseInt(this.data.substr(0, 1), 10);\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport DayOfWeek from '../../enums/DayOfWeek';\nimport MonthOfYear from '../../enums/MonthOfYear';\n\n/**\n * Ethernet Module Test\n *\n * The “XK” command is automatically sent every 30 seconds. This is\n * done regardless of whether an M1XEP Ethernet Module is present or\n * not. The XK command serves two purposes.\n *  1) It tests to see if a M1XEP Ethernet Module is connected to\n *     the Control.\n *  2) It includes the Control’s real time clock information (current\n *     Date and Time) for general purpose use, including but not limited\n *     to clock synchronization by a third party device.\n *\n * The expected response from a connected M1XEP Ethernet Module is “xk”.\n * However, the Control does not actually care or keep track of a missing\n * “xk” response UNLESS or UNTIL after a M1XEP Ethernet Module has been\n * properly enrolled with the Control. This can be accomplished via the\n * Bus Module Enrollment process (Keypad programming Menu 1) or by the RP\n * software). Once an M1XEP has been enrolled, the Control will now begin\n * tracking each response to an “XK” command, and it will display and log\n * an “Ethernet Trouble” message if an “xk” response is not received\n * within 120 seconds of the “XK” command. This response scenario is also\n * true for alarm reporting commands “AT” and “AR”. Basically, the M1XEP\n * will withhold sending the “xk” response if it should fail to complete\n * an alarm or restoral transmission after 2 attempts. This allows for\n * 1 transmission miss.\n *\n * NOTE: Control Firmware Version 4.32 and after includes the M1’s real\n * time clock information.\n *\n * @see 4.4.5 Ethernet Module Test (XK)\n */\nexport default class EthernetModuleTest extends ElkResponse {\n  static readonly COMMAND = 'XK';\n\n  readonly seconds: number;\n  readonly minutes: number;\n  readonly hour: number;\n  readonly dayOfWeek: DayOfWeek;\n  readonly dayOfMonth: number;\n  readonly monthOfYear: MonthOfYear;\n  readonly year: number;\n\n  /**\n   * True if daylight savings time is currently active; Otherwise, false.\n   */\n  readonly isDst: boolean;\n\n  /**\n   * True if the system is using 12-hour clock mode.\n   */\n  readonly is12hourClockMode: boolean;\n\n  /**\n   * True if the date display mode is \"dd/mm\"; fale if it is \"mm/dd\"\n   */\n  readonly isDateModeDayFirst: boolean;\n\n  /**\n   * A date object representing the control's realtime clock values.\n   */\n  readonly date: Date;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.seconds = parseInt(this.data.substr(0, 2), 10);\n    this.minutes = parseInt(this.data.substr(2, 2), 10);\n    this.hour = parseInt(this.data.substr(4, 2), 10);\n    this.dayOfWeek = parseInt(this.data.substr(6, 1), 10);\n    this.dayOfMonth = parseInt(this.data.substr(7, 2), 10);\n    this.monthOfYear = parseInt(this.data.substr(9, 2), 10);\n    this.year = 2000 + parseInt(this.data.substr(11, 2), 10);\n    this.isDst = this.data.substr(13, 1) === '1';\n    this.is12hourClockMode = this.data.substr(14, 1) === '1';\n    this.isDateModeDayFirst = this.data.substr(15, 1) === '1';\n\n    // TODO: What to do with this? I'm not sure we have any way of\n    // know which timezone we're dealing with. And it's not UTC.\n    this.date = new Date(\n      Date.UTC(\n        this.year,\n        this.monthOfYear - 1, // JavaScript uses 0-based months.\n        this.dayOfMonth,\n        this.hour,\n        this.minutes,\n        this.seconds\n      )\n    );\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport ZoneDefinition from '../../enums/ZoneDefinition';\n\n/**\n * Reply Alarm By Zone Report Data\n *\n * May be requested by sending a {@link AlarmByZoneRequest}\n *\n * @see 4.5.1 Reply Alarm By Zone Report Data (AZ)\n */\nexport default class AlarmByZoneReport extends ElkResponse {\n  static readonly COMMAND = 'AZ';\n\n  readonly zones: ZoneDefinition[];\n  readonly zonesInAlarm: number[];\n\n  constructor(raw: string) {\n    super(raw);\n    this.zones = Array.from(this.data).map(char => char.charCodeAt(0));\n    this.zonesInAlarm = this.zones.reduce((alarmedZones: number[], current, index) => {\n      if (current !== ZoneDefinition.Disabled) {\n        return [...alarmedZones, index + 1];\n      }\n      return alarmedZones;\n    }, []);\n  }\n\n  getZoneAlarm(zoneNumber: number): ZoneDefinition {\n    return this.zones[zoneNumber - 1];\n  }\n\n  get hasAlarms() {\n    return this.zonesInAlarm.length > 0;\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport PartyMode from '../../enums/PartyMode';\n\n/**\n * Reply With Audio Data\n *\n * Sent as a response to {@link AudioDataRequest}\n *\n * @see 4.6.2 Reply With Audio Data (CA)\n */\nexport default class AudioDataReply extends ElkResponse {\n  static readonly COMMAND = 'CA';\n\n  /**\n   * The zone number (0..18)\n   */\n  readonly zone: number;\n\n  /**\n   * Whether zone is powered.\n   */\n  readonly isPowered: boolean;\n\n  /**\n   * Source (1..12)\n   */\n  readonly source: number;\n\n  /**\n   * Volume (0..100)\n   */\n  readonly volume: number;\n\n  /**\n   * Bass (000=down(-), 50=center, 100=up(+))\n   */\n  readonly bass: number;\n\n  /**\n   * Treble (000=down(-), 50=center), 100=up(+))\n   */\n  readonly treble: number;\n\n  /**\n   * Whether loudness is turned on.\n   */\n  readonly isLoudness: boolean;\n\n  /**\n   * Balance (000=left, 50=center, 100=right)\n   */\n  readonly balance: number;\n\n  /**\n   * Party mode (‘0’=off, ‘1’=on, ‘2’=master)\n   */\n  readonly partyMode: PartyMode;\n\n  readonly isDoNotDisturb: boolean;\n\n  constructor(raw: string) {\n    super(raw);\n    this.zone = parseInt(this.data.substr(0, 2), 10);\n    this.isPowered = this.data.substr(2, 1) === '1';\n    this.source = parseInt(this.data.substr(3, 2), 10);\n    this.volume = parseInt(this.data.substr(5, 3), 10);\n    this.bass = parseInt(this.data.substr(8, 3), 10);\n    this.treble = parseInt(this.data.substr(11, 3), 10);\n    this.isLoudness = this.data.substr(14, 1) === '1';\n    this.balance = parseInt(this.data.substr(15, 3), 10);\n    this.partyMode = parseInt(this.data.substr(18, 1), 10);\n    this.isDoNotDisturb = this.data.substr(19, 1) === '1';\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Output Change Update\n *\n * This transmission update option transmits the updated status whenever\n * it changes and is enabled by setting the location TRUE in the M1 Control\n * Global Programming Locations 37.\n * Example: “Xmit OutputChgs–ASCII” (Yes or No)\n *\n * The Output Change Update will also be transmitted out M1XSP Serial Port\n * Expanders that are configured in the Generic Mode.\n *\n * @see 4.7 Output Change Update (CC)\n */\nexport default class OutputChangeUpdate extends ElkResponse {\n  static readonly COMMAND = 'CC';\n\n  readonly outputNumber: number;\n  readonly isOn: boolean;\n\n  constructor(raw: string) {\n    super(raw);\n    this.outputNumber = parseInt(this.data.substr(0, 3), 10);\n    this.isOn = this.data.substr(3, 1) === '1';\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport AudioCommand from '../../enums/AudioCommand';\n\n/**\n * Outgoing Audio Command\n *\n * A response to {@link AudioCommandIncoming}\n *\n * @see 4.8.3 Outgoing Audio Command (CD)\n */\nexport default class AudioCommandOutgoing extends ElkResponse {\n  static readonly COMMAND = 'CD';\n\n  readonly audioCommand: AudioCommand;\n  readonly audioSource: number;\n  readonly audioZone: number;\n  readonly value: number;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.audioCommand = parseInt(this.data.substr(0, 2), 10);\n    this.audioSource = parseInt(this.data.substr(2, 2), 10);\n    this.audioZone = parseInt(this.data.substr(4, 2), 10);\n    this.value = parseInt(this.data.substr(6, 3), 10);\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Control Output Status Report\n *\n * The control panel sends this message in response\n * to a {@link ControlOutputStatusRequest}. The data portion\n * of this message is 208 characters long, one character\n * for each output in order. The value will be: 0 (Off), 1 (On).\n *\n * @see 4.9.4 Control Output Status Report (CS)\n */\nexport default class ControlOutputStatusReport extends ElkResponse {\n  static readonly COMMAND = 'CS';\n\n  readonly outputStatuses: ReadonlyArray<boolean>;\n\n  constructor(raw: string) {\n    super(raw);\n    this.outputStatuses = Array.from(this.data).map(char => char === '1');\n  }\n\n  isOutputOn(outputNumber: number): boolean {\n    return this.outputStatuses[outputNumber - 1];\n  }\n}\n","import CustomValueFormat from '../enums/CustomValueFormat';\nimport CustomValue from './CustomValue';\n\n/**\n * Represents a custom value with the TimeOfDay type.\n */\nexport default class CustomTimeOfDayValue implements CustomValue {\n  static decode(input: string) {\n    const decimalValue = parseInt(input, 10);\n    const hexValue = decimalValue.toString(16);\n    const hour = parseInt(hexValue.substr(0, 2), 16);\n    const minutes = parseInt(hexValue.substr(2, 2), 16);\n    return new CustomTimeOfDayValue(hour, minutes);\n  }\n\n  readonly format: CustomValueFormat = CustomValueFormat.TimeOfDay;\n\n  constructor(readonly hour: number, readonly minutes: number) {}\n\n  encode() {\n    const timeInHex =\n      this.hour.toString(16).padStart(2, '0') + this.minutes.toString(16).padStart(2, '0');\n    return parseInt(timeInHex, 16)\n      .toString()\n      .padStart(5, '0');\n  }\n}\n","import CustomValueFormat from '../enums/CustomValueFormat';\nimport CustomValue from './CustomValue';\n\n/**\n * Represents a custom value of Number or Timer type.\n */\nexport default class CustomNumberValue implements CustomValue {\n  static decode(input: string, format: CustomValueFormat) {\n    const decimalValue = parseInt(input, 10);\n    return new CustomNumberValue(decimalValue, format);\n  }\n\n  constructor(\n    readonly value: number,\n    readonly format: CustomValueFormat = CustomValueFormat.Number\n  ) {\n    if (format === CustomValueFormat.TimeOfDay) {\n      throw new Error(\n        'CustomNumberValue format must be Number or Timer. Use CustomTimeOfDayValue for TimeOfDay format.'\n      );\n    }\n  }\n\n  encode() {\n    return this.value.toString().padStart(5, '0');\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport CustomValue from '../../models/CustomValue';\nimport { CustomValueFormat } from '../../enums';\nimport CustomTimeOfDayValue from '../../models/CustomTimeOfDayValue';\nimport CustomNumberValue from '../../models/CustomNumberValue';\n\nconst SPLIT_ALL_REGEX = /.{1,6}/g;\n\n/**\n * Reply With Custom Value\n *\n * Sent in response to a {@link CustomValueRead}\n * or {@link CustomValuesReadAll}\n *\n * @see 4.10.3 Reply With Custom Value (CR)\n */\nexport default class CustomValueReply extends ElkResponse {\n  static readonly COMMAND = 'CR';\n\n  static decodeCustomValue(input: string): CustomValue {\n    const value = input.substr(0, 5);\n    const format = parseInt(input.substr(5, 1), 10);\n    return format === CustomValueFormat.TimeOfDay\n      ? CustomTimeOfDayValue.decode(value)\n      : CustomNumberValue.decode(value, format);\n  }\n\n  readonly values: CustomValue[];\n\n  /**\n   * If only a single value was returned, this will be the value's number and\n   * `values` will contains a single value.\n   * If all values were returned, this will be 0 and `values` will contain all 20\n   * custom values.\n   */\n  readonly valueNumber: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.valueNumber = parseInt(this.data.substr(0, 2), 10);\n\n    if (this.valueNumber === 0) {\n      // ALL values were returned.\n      const matches = this.data.substr(2).match(SPLIT_ALL_REGEX);\n      this.values = matches\n        ? matches.map((chunk, index) => CustomValueReply.decodeCustomValue(chunk.substr(0, 6)))\n        : [];\n    } else {\n      this.values = [CustomValueReply.decodeCustomValue(this.data.substr(2, 6))];\n    }\n  }\n\n  getCustomValue(valueNumber: number = 1): CustomValue {\n    return this.values[valueNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport UserCodeChangeType from '../../enums/UserCodeChangeType';\n\n/**\n * Reply Change User Code\n *\n * Response to {@link UserCodeChangeRequest}\n *\n * @see 4.11.2 Reply Change User Code (CU)\n */\nexport default class UserCodeChangeReply extends ElkResponse {\n  static readonly COMMAND = 'CU';\n\n  readonly userCode: number;\n  readonly isSuccessful: boolean;\n  readonly isInvalidAuthorizationCode: boolean;\n  readonly isDuplicateCode: boolean;\n  readonly changeType: UserCodeChangeType;\n\n  constructor(raw: string) {\n    super(raw);\n    this.userCode = parseInt(this.data.substr(0, 3), 10);\n    this.isSuccessful = this.userCode > 0 && this.userCode < 255;\n    this.isInvalidAuthorizationCode = this.userCode === 0;\n    this.isDuplicateCode = this.userCode === 255;\n    this.changeType = this.reserved ? parseInt(this.reserved[0], 10) : UserCodeChangeType.UserCode;\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply With Counter Value Format\n *\n * Sent in response to a {@link CounterValuRead}\n *\n * 4.12.3 Reply With Counter Value Format (CV)\n */\nexport default class CounterValueReply extends ElkResponse {\n  static readonly COMMAND = 'CV';\n\n  readonly counterNumber: number;\n  readonly value: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.counterNumber = parseInt(this.data.substr(0, 2), 10);\n    this.value = parseInt(this.data.substr(2, 5), 10);\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply Lighting Device Status Data\n *\n * @see 4.14.2 Reply Lighting Device Status Data (DS)\n */\nexport default class LightingDeviceDataReply extends ElkResponse {\n  static readonly COMMAND = 'DS';\n\n  /**\n   * The lighting device number (1..256)\n   */\n  readonly lightingDeviceNumber: number;\n\n  /**\n   * The lighting level, 0..100, where 0 = off, 100 = full on, and\n   * anything in between is the dim level.\n   * NOTE: this is different than what the M1 returns, which will\n   * return a `1` for full on.\n   */\n  readonly lightingLevel: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.lightingDeviceNumber = parseInt(this.data.substr(0, 3), 10);\n    this.lightingLevel = parseInt(this.data.substr(3, 2), 10);\n\n    if (this.lightingLevel === 1) {\n      this.lightingLevel = 100;\n    }\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport { ArmingLevel } from '../../enums';\n\n/**\n * Send Entry/Exit Data\n *\n * This sends the entry 1 & 2 and exit 1 & 2 time data when the timers\n * start by area. When each exit timer expires an “EE” command is also\n * transmitted.\n * M1 Version 4.1.12, 5.1.12 or later.\n * Armed State available in 4.1.18, 5.1.18 or later.\n *\n * @see 4.15.1 Send Entry/Exit Data (EE)\n */\nexport default class ExntryExitTimer extends ElkResponse {\n  static readonly COMMAND = 'EE';\n\n  readonly isEntry: boolean;\n\n  /**\n   * Area number where alarm occured\n   */\n  readonly areaNumber: number;\n\n  readonly timer1: number;\n  readonly timer2: number;\n  readonly armingLevel: ArmingLevel;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.areaNumber = parseInt(this.data.substr(0, 1), 10);\n    this.isEntry = this.data.substr(1, 1) === '1';\n    this.timer1 = parseInt(this.data.substr(2, 3), 10);\n    this.timer2 = parseInt(this.data.substr(5, 3), 10);\n    this.armingLevel = this.data.charCodeAt(8);\n  }\n\n  get isExit() {\n    return !this.isEntry;\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Send Email Trigger\n *\n * This command allows the triggering of email transmissions from\n * the M1XEP Ethernet interface. This command originates in the M1\n * and is sent to the M1XEP through serial port 0 only.\n * M1 Version 4.2.8 and after.\n *\n * @see 4.16.1 Send Email Trigger Data (EM)\n */\nexport default class EmailSendTrigger extends ElkResponse {\n  static readonly COMMAND = 'EM';\n\n  readonly emailAddressNumber: number;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.emailAddressNumber = parseInt(this.data.substr(0, 3), 10);\n  }\n}\n","/**\n * Matches on a user-entered code.\n */\nconst USER_CODE_REGEX = /^(0\\d)(0\\d)(0\\d)(0\\d)(0\\d)(0\\d)$/;\n\nexport default class UserCode {\n  static decode(input: string) {\n    const userCodeMatch = input.match(USER_CODE_REGEX);\n\n    if (userCodeMatch) {\n      // The regex match result contains the entire string as index 0,\n      // and each match as index 1..7. Each of those will be preceded by\n      // a zero, so exclude those \"0\" characters and join them to get the\n      // code.\n      return new UserCode(\n        userCodeMatch\n          .slice(1, 7)\n          .map(char => char[1])\n          .join(''),\n        false\n      );\n    } else {\n      return new UserCode(input, true);\n    }\n  }\n\n  constructor(readonly code: string, readonly isProximityCard: boolean = false) {}\n\n  encode(width = 12) {\n    if (this.isProximityCard) {\n      return this.code.padStart(width, '0');\n    }\n\n    return Array.from(this.code)\n      .map(char => `0${char}`)\n      .join('')\n      .padStart(width, '0');\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport UserCode from '../../models/UserCode';\n\n/**\n * Send Valid User Number And Invalid User Code\n *\n * This ASCII Data Packet will be sent when a user code is entered\n * and a valid code is found. Only the valid user code number will be\n * returned. If a user code is not found in the M1’s User Code Data\n * Base, the code that was enter will be sent. If the User Code\n * Length is set to 4 digits, the invalid data packet will be sent\n * after 4 digits are entered, then repeated for each additional\n * invalid user code digit. If the User Code Length is set to 6\n * digits, the invalid data packet will be sent after 6 digits\n * are entered, then repeated for each additional invalid user\n * digit. If prox card data is enter, the packet will be sent\n * immediately. This data can be used by automation equipment\n * with its own user code data base. The automation equipment\n * would sent the appropriate arm/disarm command (“a0” to “a6”)\n * or output relay control commands (“cn”, “cf”, or “ct”) back\n * to the M1 after it has verified the proper code is in its data\n * base. Modified for 26 bit Weigand data cards and available in\n * M1 Version 4.2.8 and after.\n *\n * @see 4.17 Send Valid User Number And Invalid User Code (IC)\n */\nexport default class UserCodeEntry extends ElkResponse {\n  static readonly COMMAND = 'IC';\n\n  readonly userCode: UserCode;\n\n  readonly userNumber: number;\n\n  readonly keypadNumber: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.userCode = UserCode.decode(this.data.substr(0, 12));\n    this.userNumber = parseInt(this.data.substr(12, 3), 10);\n    this.keypadNumber = parseInt(this.data.substr(15, 3), 10);\n  }\n\n  get isValidEntry() {\n    return this.userNumber !== 0;\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Installer Mode Exited\n *\n * This command is automatically sent through serial port 0 only\n * when the installer mode is terminated. This is done by pressing\n * the “*” key three times or the installer timer runs out. This\n * command is used by the M1XEP Ethernet Interface to know when to\n * reload M1 program data after an installer has done any keypad\n * programming. M1 Version 4.2.8 and after.\n *\n * @see 4.18.1 Send Installer Mode Exited (IE)\n */\nexport default class InstallerModeExited extends ElkResponse {\n  static readonly COMMAND = 'IE';\n}\n","import ElkResponse from './ElkResponse';\n\nconst SPLIT_DEVICE_IDS_REGEX = /.{1,6}/g;\n\n/**\n * Reply Read Of Insteon Lighting Device Data\n *\n * @see 4.19.4 Reply Read Of Insteon Lighting Device Data (IR)\n */\nexport default class InsteonLightingDeviceStatusReply extends ElkResponse {\n  static readonly COMMAND = 'IR';\n\n  readonly startingDeviceNumber: number;\n  readonly deviceCount: number;\n  readonly deviceIds: string[];\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.startingDeviceNumber = parseInt(this.data.substr(0, 3), 10);\n    this.deviceCount = parseInt(this.data.substr(3, 1), 10);\n    this.deviceIds = this.data.substr(4).match(SPLIT_DEVICE_IDS_REGEX) || [];\n  }\n\n  get endingDeviceNumber() {\n    return this.startingDeviceNumber + this.deviceCount - 1;\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply With Keypad Areas\n *\n * @see 4.20.2 Reply With Keypad Areas (KA)\n */\nexport default class KeypadAreaAssignments extends ElkResponse {\n  static readonly COMMAND = 'KA';\n\n  readonly areas: number[];\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.areas = Array.from(this.data.substr(0, 16)).map(area => parseInt(area, 10));\n  }\n\n  getKeypadArea(keypad: number) {\n    return this.areas[keypad - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport BeepAndChimeMode from '../../enums/BeepAndChimeMode';\nimport KeypadKey from '../../enums/KeypadKey';\nimport IlluminationStatus from '../../enums/IlluminationStatus';\n\n/**\n * Keypad KeyChange Update\n *\n * @see 4.21 Keypad KeyChange Update (KC)\n */\nexport default class KeypadKeyChange extends ElkResponse {\n  static readonly COMMAND = 'KC';\n\n  readonly keypadNumber: number;\n  readonly keyPressed: KeypadKey;\n  readonly functionKeyIlluminations: IlluminationStatus[];\n  readonly isCodeRequiredToBypass: boolean;\n  readonly areaBeepAndChimeModes: BeepAndChimeMode[];\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.keypadNumber = parseInt(this.data.substr(0, 2), 10);\n    this.keyPressed = parseInt(this.data.substr(2, 2), 10);\n    this.functionKeyIlluminations = Array.from(this.data.substr(4, 6)).map(illumination =>\n      illumination.charCodeAt(0)\n    );\n    this.isCodeRequiredToBypass = this.data.substr(10, 1) === '1';\n    this.areaBeepAndChimeModes = Array.from(this.data.substr(11, 8)).map(mode =>\n      mode.charCodeAt(0)\n    );\n  }\n\n  getBeepAndChimeMode(areaNumber: number) {\n    return this.areaBeepAndChimeModes[areaNumber - 1];\n  }\n\n  getFunctionKeyIllumination(keyNumber: number) {\n    return this.functionKeyIlluminations[keyNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport FunctionKey from '../../enums/FunctionKey';\nimport ChimeMode from '../../enums/ChimeMode';\n\n/**\n * Reply Keypad Function Key Press\n *\n * @see 4.22.2 Reply Keypad Function Key Press (KF)\n */\nexport default class KeypadFunctionKeyPressReply extends ElkResponse {\n  static readonly COMMAND = 'KF';\n\n  readonly keypadNumber: number;\n  readonly functionKey: FunctionKey;\n  readonly chimeModes: ChimeMode[];\n\n  constructor(raw: string) {\n    super(raw);\n    this.keypadNumber = parseInt(this.data.substr(0, 2), 10);\n    this.functionKey = this.data.substr(2, 1).charCodeAt(0);\n    this.chimeModes = Array.from(this.data.substr(3, 8)).map(char => char.charCodeAt(0));\n  }\n\n  getChimeMode(areaNumber: number) {\n    return this.chimeModes[areaNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport DayOfWeek from '../../enums/DayOfWeek';\n\n/**\n * System Log Data Update\n *\n * As the control log is written, the same information is\n *  sent out the RS-232 port. The log information will have\n * the ddd index value set to “000” to indicate a logging\n * entry.\n *\n * The log data may also be requested with the “ld”\n * (lower case “LD”) command below. Modified in M1 version 4.3.2\n *\n * The “System Log Data Update” transmission option, transmits the\n * updated status whenever it changes and is enabled by setting the\n * location TRUE in the M1 Control Global Programming Locations 35.\n * Example: “Xmit Event Log–ASCII” (Yes or No). The request for log\n * data “ld” is not controlled by this option.\n *\n * @see 4.23 System Log Data Update (LD)\n */\nexport default class SystemLogDataUpdate extends ElkResponse {\n  static readonly COMMAND = 'LD';\n\n  readonly logIndex: number;\n  readonly event: number;\n  readonly eventNumberData: number;\n  readonly areaNumber: number;\n  readonly hour: number;\n  readonly minutes: number;\n  readonly month: number;\n  readonly day: number;\n  readonly dayOfWeek: DayOfWeek;\n  readonly year: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.event = parseInt(this.data.substr(0, 4), 10);\n    this.eventNumberData = parseInt(this.data.substr(4, 3), 10);\n    this.areaNumber = parseInt(this.data.substr(7, 1), 10);\n    this.hour = parseInt(this.data.substr(8, 2), 10);\n    this.minutes = parseInt(this.data.substr(10, 2), 10);\n    this.month = parseInt(this.data.substr(12, 2), 10);\n    this.day = parseInt(this.data.substr(14, 2), 10);\n    this.logIndex = parseInt(this.data.substr(16, 3), 10);\n    this.dayOfWeek = parseInt(this.data.substr(19, 1), 10);\n    this.year = 2000 + parseInt(this.data.substr(20, 2), 10);\n  }\n}\n","import ElkResponse from './ElkResponse';\n\nconst SPLIT_CHUNKS_REGEX = /.{1,3}/g;\n\n/**\n * Reply Temperature Data\n *\n * @see 4.24.2 Reply Temperature Data (LW)\n */\nexport default class TemperatureData extends ElkResponse {\n  static readonly COMMAND = 'LW';\n\n  readonly keypadTemperatures: number[];\n  readonly zoneTemperatures: number[];\n\n  constructor(raw: string) {\n    super(raw);\n\n    const keypadMatches = this.data.substr(0, 3 * 16).match(SPLIT_CHUNKS_REGEX);\n    const zoneMatches = this.data.substr(3 * 16).match(SPLIT_CHUNKS_REGEX);\n\n    this.keypadTemperatures = keypadMatches\n      ? keypadMatches.map(temp => parseInt(temp, 10) - 40)\n      : [];\n    this.zoneTemperatures = zoneMatches ? zoneMatches.map(temp => parseInt(temp, 10) - 60) : [];\n  }\n\n  getKeypadTemperature(keypadNumber: number) {\n    return this.keypadTemperatures[keypadNumber - 1];\n  }\n\n  getZoneSensorTemperature(zoneNumber: number) {\n    return this.zoneTemperatures[zoneNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * PLC Change Update\n *\n * Special: When an AllLightsOn, AllLightsOff, or AllUnitsOff\n * command is transmitted the Unit Code will equal 00, and the Level (LL)\n * will be:\n * * AllLightsOn = 02\n * * AllLightsOff = 07\n * * AllUnitsOff = 01\n *\n * This transmission update option transmits the updated status whenever\n * it changes and is enabled by setting the location TRUE in the M1\n * Control Global Programming Location 39.\n * Example: “Xmit Light Chgs– ASCII” (Yes or No)\n *\n * @see 4.25.2 PLC Change Update (PC)\n */\nexport default class PlcChangeUpdate extends ElkResponse {\n  static readonly COMMAND = 'PC';\n\n  readonly houseCode: string;\n  readonly unitCode: number;\n  readonly level: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.houseCode = this.data[0];\n    this.unitCode = parseInt(this.data.substr(1, 2), 10);\n    this.level = parseInt(this.data.substr(3, 2), 10);\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Returned PLC status\n *\n * @see 4.25.6 Returned PLC status (PS)\n */\nexport default class PlcDeviceStatusReply extends ElkResponse {\n  static readonly COMMAND = 'PS';\n\n  readonly bank: number;\n  readonly levels: number[];\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.bank = parseInt(this.data[0], 10);\n    this.levels = Array.from(this.data.substr(1, 64)).map(value => parseInt(value, 10));\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reset Ethernet Module\n *\n * This command is originated from the M1 and causes the M1XEP\n * Ethernet Module to reset its processor and/or its IP address\n * to: 192.168.0.251. This can be used when the IP address of the\n * M1XEP is set to an unknown value. This is accessed through the\n * M1’s Keypad Global Installer Programming, Option 45, then enter\n * 96. M1 Version 4.3.7 and after.\n *\n * @see 4.26 Reset Ethernet Module (RE)\n */\nexport default class EthernetModuleReset extends ElkResponse {\n  static readonly COMMAND = 'RE';\n\n  readonly isIpAddressReset: boolean;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.isIpAddressReset = this.data[0] === '1';\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * ELKRP software Connected\n *\n * The M1XEP sends the following ASCII command out to\n * all socket connected devices when ELK RP,\n * Upload/Download Software, disconnects from the M1\n *\n * @see 4.27 ELKRP Connected (RP)\n */\nexport default class ElkRPConnected extends ElkResponse {\n  static readonly COMMAND = 'RP';\n\n  readonly connectMessageType: string;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.connectMessageType = this.data[1];\n  }\n\n  get isDisconnectBroadcast() {\n    return this.connectMessageType === '0';\n  }\n\n  get isPollReply() {\n    return this.connectMessageType === '1';\n  }\n\n  get isInitializing() {\n    return this.connectMessageType === '2';\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport DayOfWeek from '../../enums/DayOfWeek';\nimport MonthOfYear from '../../enums/MonthOfYear';\n\n/**\n * Reply Real Time Clock Data\n *\n * @see 4.28.2 Reply Real Time Clock Data (RR)\n */\nexport default class RealTimeClockDataReply extends ElkResponse {\n  static readonly COMMAND = 'RR';\n\n  readonly seconds: number;\n  readonly minutes: number;\n  readonly hour: number;\n  readonly dayOfWeek: DayOfWeek;\n  readonly dayOfMonth: number;\n  readonly monthOfYear: MonthOfYear;\n  readonly year: number;\n\n  /**\n   * True if daylight savings time is currently active; Otherwise, false.\n   */\n  readonly isDst: boolean;\n\n  /**\n   * True if the system is using 12-hour clock mode.\n   */\n  readonly is12hourClockMode: boolean;\n\n  /**\n   * True if the date display mode is \"dd/mm\"; fale if it is \"mm/dd\"\n   */\n  readonly isDateModeDayFirst: boolean;\n\n  /**\n   * A date object representing the control's realtime clock values.\n   */\n  readonly date: Date;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.seconds = parseInt(this.data.substr(0, 2), 10);\n    this.minutes = parseInt(this.data.substr(2, 2), 10);\n    this.hour = parseInt(this.data.substr(4, 2), 10);\n    this.dayOfWeek = parseInt(this.data.substr(6, 1), 10);\n    this.dayOfMonth = parseInt(this.data.substr(7, 2), 10);\n    this.monthOfYear = parseInt(this.data.substr(9, 2), 10);\n    this.year = 2000 + parseInt(this.data.substr(11, 2), 10);\n    this.isDst = this.data.substr(13, 1) === '1';\n    this.is12hourClockMode = this.data.substr(14, 1) === '1';\n    this.isDateModeDayFirst = this.data.substr(15, 1) === '1';\n\n    // TODO: What to do with this? I'm not sure we have any way of\n    // know which timezone we're dealing with. And it's not UTC.\n    this.date = new Date(\n      Date.UTC(\n        this.year,\n        this.monthOfYear - 1, // JavaScript uses 0-based months.\n        this.dayOfMonth,\n        this.hour,\n        this.minutes,\n        this.seconds\n      )\n    );\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport TextDescriptionType from '../../enums/TextDescriptionType';\n\n/**\n * Reply With ASCII String Text Descriptions\n *\n * Sent as a response to {@link TextDescriptionRequest}\n *\n * @see 4.29.2 Reply With ASCII String Text Descriptions (SD)\n */\nexport default class TextDescriptionReply extends ElkResponse {\n  static readonly COMMAND = 'SD';\n\n  readonly textType: TextDescriptionType;\n  readonly address: number;\n  readonly text: string;\n\n  constructor(raw: string) {\n    super(raw);\n    this.textType = parseInt(this.data.substr(0, 2), 10);\n    this.address = parseInt(this.data.substr(2, 3), 10);\n    this.text = this.data.substr(5, 16).trim();\n\n    if (this.text.charCodeAt(0) > 127) {\n      // Note: The high bit of the first character in the text string may be set as the\n      // “Show On Keypad” bit. Mask out the high bit for proper ASCII display.\n      this.text = String.fromCharCode(this.text.charCodeAt(0) - 128) + this.text.substr(1);\n    }\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport SystemTroubleType from '../../enums/SystemTroubleType';\n\n/**\n * Reply System Trouble Status\n *\n * This command allows automation equipment to poll\n * for system trouble status. Firmware revision 4.5.4,\n * 5.1.4 and after. This message will automatically\n * be sent upon a trouble status change.\n *\n * @see 4.30.2 Reply System Trouble Status (SS)\n */\nexport default class SystemTroubleStatusReply extends ElkResponse {\n  static readonly COMMAND = 'SS';\n\n  readonly troubles: SystemTroubleType = SystemTroubleType.None;\n  readonly boxTamperTroubleZone?: number;\n  readonly transmitterLowBatteryTroubleZone?: number;\n  readonly securityAlertTroubleZone?: number;\n  readonly lostTransmitterTroubleZone?: number;\n  readonly fireTroubleZone?: number;\n\n  constructor(raw: string) {\n    super(raw);\n\n    if (this.data[0] === '1') {\n      this.troubles |= SystemTroubleType.ACFail;\n    }\n\n    if (this.data[1] !== '0') {\n      this.troubles |= SystemTroubleType.BoxTamper;\n      this.boxTamperTroubleZone = this.data.charCodeAt(1) - 48;\n    }\n\n    if (this.data[2] === '1') {\n      this.troubles |= SystemTroubleType.FailToCommunicate;\n    }\n\n    if (this.data[3] === '1') {\n      this.troubles |= SystemTroubleType.EEPromMemoryError;\n    }\n\n    if (this.data[4] === '1') {\n      this.troubles |= SystemTroubleType.LowBatteryControl;\n    }\n\n    if (this.data[5] !== '0') {\n      this.troubles |= SystemTroubleType.TransmitterLowBattery;\n      this.transmitterLowBatteryTroubleZone = this.data.charCodeAt(5) - 48;\n    }\n\n    if (this.data[6] === '1') {\n      this.troubles |= SystemTroubleType.OverCurrent;\n    }\n\n    if (this.data[7] === '1') {\n      this.troubles |= SystemTroubleType.TelephoneFault;\n    }\n\n    if (this.data[9] === '1') {\n      this.troubles |= SystemTroubleType.Output2;\n    }\n\n    if (this.data[10] === '1') {\n      this.troubles |= SystemTroubleType.MissingKeypad;\n    }\n\n    if (this.data[11] === '1') {\n      this.troubles |= SystemTroubleType.ZoneExpander;\n    }\n\n    if (this.data[12] === '1') {\n      this.troubles |= SystemTroubleType.OutputExpander;\n    }\n\n    if (this.data[14] === '1') {\n      this.troubles |= SystemTroubleType.ELKRPRemoteAccess;\n    }\n\n    if (this.data[16] === '1') {\n      this.troubles |= SystemTroubleType.CommonAreaNotArmed;\n    }\n\n    if (this.data[17] === '1') {\n      this.troubles |= SystemTroubleType.FlashMemoryError;\n    }\n\n    if (this.data[18] !== '0') {\n      this.troubles |= SystemTroubleType.SecurityAlert;\n      this.securityAlertTroubleZone = this.data.charCodeAt(18) - 48;\n    }\n\n    if (this.data[19] === '1') {\n      this.troubles |= SystemTroubleType.SerialPortExpander;\n    }\n\n    if (this.data[20] !== '0') {\n      this.troubles |= SystemTroubleType.LostTransmitter;\n      this.lostTransmitterTroubleZone = this.data.charCodeAt(20) - 48;\n    }\n\n    if (this.data[21] === '1') {\n      this.troubles |= SystemTroubleType.GESmokeCleanMe;\n    }\n\n    if (this.data[22] === '1') {\n      this.troubles |= SystemTroubleType.EthernetTrouble;\n    }\n\n    if (this.data[31] === '1') {\n      this.troubles |= SystemTroubleType.DisplayMessageInKeypadLine1;\n    }\n\n    if (this.data[32] === '1') {\n      this.troubles |= SystemTroubleType.DisplayMessageInKeypadLine2;\n    }\n\n    if (this.data[33] !== '0') {\n      this.troubles |= SystemTroubleType.FireTrouble;\n      this.fireTroubleZone = this.data.charCodeAt(33) - 48;\n    }\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport TemperatureDeviceType from '../../enums/TemperatureDeviceType';\n\n/**\n * Reply With Requested Temperature\n *\n * @see 4.31.2 Reply With Requested Temperature (ST)\n */\nexport default class TemperatureReply extends ElkResponse {\n  static readonly COMMAND = 'ST';\n\n  readonly deviceType: TemperatureDeviceType;\n  readonly deviceNumber: number;\n  readonly temperature: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.deviceType = parseInt(this.data.substr(0, 1), 10);\n    this.deviceNumber = parseInt(this.data.substr(1, 2), 10);\n    this.temperature = parseInt(this.data.substr(3, 3), 10);\n\n    if (this.deviceType === TemperatureDeviceType.TemperatureProbe) {\n      this.temperature -= 60;\n    } else if (this.deviceType === TemperatureDeviceType.Keypad) {\n      this.temperature -= 40;\n    }\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Tasks Change Update\n *\n * This transmission update option transmits the updated status whenever\n * it changes and is enabled by setting the location TRUE in the M1 Control\n * Global Programming Location 38. Example: “Xmit Task Chgs – ASCII” (Yes\n * or No)\n *\n * @see 4.33 Tasks Change Update (TC)\n */\nexport default class TaskChangeUpdate extends ElkResponse {\n  static readonly COMMAND = 'TC';\n\n  readonly taskNNumber: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.taskNNumber = parseInt(this.data.substr(0, 3), 10);\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport ThermostatMode from '../../enums/ThermostatMode';\n\n/**\n * Reply Thermostat Data\n *\n * @see 4.35.2 Reply Thermostat Data (TR)\n */\nexport default class ThermostatData extends ElkResponse {\n  static readonly COMMAND = 'TR';\n\n  readonly thermostatNumber: number;\n  readonly thermostatMode: ThermostatMode;\n  readonly thermostatHold: boolean;\n  readonly thermostatFanOn: boolean;\n  readonly temperature?: number;\n  readonly heatSetPoint?: number;\n  readonly coolSetPoint?: number;\n  readonly humidity?: number;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.thermostatNumber = parseInt(this.data.substr(0, 2), 10);\n    this.thermostatMode = this.data.charCodeAt(2);\n    this.thermostatHold = this.data[3] === '1';\n    this.thermostatFanOn = this.data[4] === '1';\n    this.temperature = parseInt(this.data.substr(5, 2), 10) || undefined;\n    this.heatSetPoint = parseInt(this.data.substr(7, 2), 10) || undefined;\n    this.coolSetPoint = parseInt(this.data.substr(9, 2), 10) || undefined;\n    this.humidity = parseInt(this.data.substr(11, 2), 10) || undefined;\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply - M1 to PC with Omnistat 2 ASCII Hex data\n *\n * This is the reply from the M1XSP connected to the HAI Omnistat\n * 2 HVAC Thermostat. M1 version 5.1.9 or later is required for\n * this command.\n *\n * @see 4.35.5 Reply - M1 to PC with Omnistat 2 ASCII Hex data (T2)\n */\nexport default class Omnistat2Reply extends ElkResponse {\n  static readonly COMMAND = 'T2';\n}\n","import ElkResponse from './ElkResponse';\n\nfunction versionsToString(major: number, minor: number, patch: number) {\n  return `${major.toString().padStart(2, '0')}.${minor\n    .toString()\n    .padStart(2, '0')}.${patch.toString().padStart(2, '0')}`;\n}\n\n/**\n * Reply M1 Version Number\n *\n * Response to {@link VersionNumberRequest}\n *\n * @see 4.36.2 Reply M1 Version Number (VN)\n */\nexport default class VersionNumberReply extends ElkResponse {\n  static readonly COMMAND = 'VN';\n\n  readonly m1Major: number;\n  readonly m1Minor: number;\n  readonly m1Patch: number;\n  readonly m1xepMajor: number;\n  readonly m1xepMinor: number;\n  readonly m1xepPatch: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.m1Major = parseInt(this.data.substr(0, 2), 16);\n    this.m1Minor = parseInt(this.data.substr(2, 2), 16);\n    this.m1Patch = parseInt(this.data.substr(4, 2), 16);\n    this.m1xepMajor = parseInt(this.data.substr(6, 2), 16);\n    this.m1xepMinor = parseInt(this.data.substr(8, 2), 16);\n    this.m1xepPatch = parseInt(this.data.substr(10, 2), 16);\n  }\n\n  get m1Version() {\n    return versionsToString(this.m1Major, this.m1Minor, this.m1Patch);\n  }\n\n  get m1XepVersion() {\n    return versionsToString(this.m1xepMajor, this.m1xepMinor, this.m1xepPatch);\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport UserCodeType from '../../enums/UserCodeType';\n\n/**\n * Reply With Valid User Code Areas\n *\n * @see 4.37.2 Reply With Valid User Code Areas (UA)\n */\nexport default class UserCodeAreasReply extends ElkResponse {\n  static readonly COMMAND = 'UA';\n\n  readonly userCode: string;\n  readonly diagnosticData: string;\n  readonly userCodeLength: number;\n  readonly userCodeType: UserCodeType;\n  readonly temperatureMode: string;\n  readonly areas: boolean[];\n\n  constructor(raw: string) {\n    super(raw);\n    this.userCode = this.data.substr(0, 6);\n    const areaBits = parseInt(this.data.substr(6, 2), 16).toString(2);\n    this.areas = Array.from(areaBits).map(bit => bit === '1');\n    this.diagnosticData = this.data.substr(8, 8);\n    this.userCodeLength = parseInt(this.data.substr(16, 1), 10);\n    this.userCodeType = this.data.charCodeAt(17);\n    this.temperatureMode = this.data[18];\n  }\n\n  isValidForArea(areaNumber: number) {\n    return this.areas[areaNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * This message is used to inform User Interfaces that an alarm\n * memory is present and must be cleared before an arm command will arm the system.\n *\n * @see 4.38 Alarm Memory Update (AM)\n */\nexport default class AlarmMemoryUpdate extends ElkResponse {\n  static readonly COMMAND = 'AM';\n\n  /**\n   * An array containing the alarm memory status of each area.\n   * If the value is true, there is an alarm memory present for\n   * the area. Index 0 indicates area 1's alarm memory status,\n   * index 1 indicates area 2's alarm memory status, etc.\n   */\n  readonly areas: boolean[];\n\n  constructor(raw: string) {\n    super(raw);\n\n    // The alarm memory response uses the reserved characters as\n    // part of it's data (or depending on how you look at it,\n    // doesn't *have* the reserved characters.\n    const data = this.data + this.reserved;\n    this.areas = Array.from(data.substr(0, 8)).map(char => char === '1');\n  }\n\n  /**\n   * Returns a value indicating whether there is an alarm memory\n   * present in the given area.\n   * @param areaNumber The area number (1..8)\n   */\n  isAlarmMemoryPresent(areaNumber: number) {\n    return this.areas[areaNumber - 1];\n  }\n}\n","import ZonePhysicalState from '../enums/ZonePhysicalState';\nimport ZoneLogicalState from '../enums/ZoneLogicalState';\n\nexport default class ZoneStatus {\n  static parse(hexValue: string) {\n    const statusBits = parseInt(hexValue, 16)\n      .toString(2)\n      .padStart(4, '0');\n    const logicalState = parseInt(statusBits.substr(0, 2), 2);\n    const physicalState = parseInt(statusBits.substr(2, 2), 2);\n    return new ZoneStatus(logicalState, physicalState);\n  }\n\n  readonly hexValue: string;\n\n  constructor(readonly logicalState: ZoneLogicalState, readonly physicalState: ZonePhysicalState) {\n    this.hexValue = parseInt(\n      logicalState.toString(2).padStart(2, '0') + physicalState.toString(2).padStart(2, '0'),\n      2\n    )\n      .toString(16)\n      .toUpperCase();\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport ZoneStatus from '../../models/ZoneStatus';\n\n/**\n * Zone Change Update\n *\n * This transmission update option transmits the updated status\n * whenever it changes and is enabled by setting the location\n * TRUE in the M1 Control Global Programming Location 36.\n * Example: “Xmit Zone Chgs–ASCII” (Yes or No)\n *\n * @see 4.39 Zone Change Update (ZC)\n */\nexport default class ZoneChangeUpdate extends ElkResponse {\n  static readonly COMMAND = 'ZC';\n\n  readonly zoneNumber: number;\n  readonly zoneStatus: ZoneStatus;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.zoneNumber = parseInt(this.data.substr(0, 3), 10);\n    this.zoneStatus = ZoneStatus.parse(this.data[3]);\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply With Bypassed Zone State\n *\n * @see 4.40.2 Reply With Bypassed Zone State (ZB)\n */\nexport default class ZoneBypassReply extends ElkResponse {\n  static readonly COMMAND = 'ZB';\n\n  readonly zoneNumber: number;\n  readonly isBypassed: boolean;\n\n  constructor(raw: string) {\n    super(raw);\n    this.zoneNumber = parseInt(this.data.substr(0, 3), 10);\n    this.isBypassed = this.data[3] === '1';\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Zone Partition Report\n *\n * The control panel sends this message in response to a\n * Zone Partition Request. The data portion, D, of this\n * message is 208 characters long, one character for each\n * zone in order. The value will be from 1-8.\n *\n * @see 4.40.4 Zone Partition Report (ZP)\n */\nexport default class ZonePartitionReport extends ElkResponse {\n  static readonly COMMAND = 'ZP';\n\n  readonly zonePartitions: number[];\n\n  constructor(raw: string) {\n    super(raw);\n    this.zonePartitions = Array.from(this.data).map(char => parseInt(char, 10));\n  }\n\n  getZoneArea(zoneNumber: number) {\n    return this.zonePartitions[zoneNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\nimport ZoneStatus from '../../models/ZoneStatus';\n\n/**\n * Zone Status Report\n *\n * The control panel sends this message in response\n * to a Zone Status Request. The data portion of this\n * message is 208 characters long, one character for\n * each zone in order. Each character is the sum of\n * all applicable status values, expressed in hexadecimal,\n * using ASCII characters 0-9 and A-F.\n * @see 4.40.6 Zone Status Report (ZS)\n */\nexport default class ZoneStatusReport extends ElkResponse {\n  static readonly COMMAND = 'ZS';\n\n  readonly zoneStatuses: ZoneStatus[];\n\n  constructor(raw: string) {\n    super(raw);\n    this.zoneStatuses = Array.from(this.data).map(char => ZoneStatus.parse(char));\n  }\n\n  getZoneStatus(zoneNumber: number) {\n    return this.zoneStatuses[zoneNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply Zone Definition Data\n *\n * @see 4.41.2 Reply Zone Definition Data (ZD)\n */\nexport default class ZoneDefinitionData extends ElkResponse {\n  static readonly COMMAND = 'ZD';\n\n  readonly zoneDefinitions: number[];\n\n  constructor(raw: string) {\n    super(raw);\n    this.zoneDefinitions = Array.from(this.data).map(char => char.charCodeAt(0));\n  }\n\n  getZoneDefinition(zoneNumber: number) {\n    return this.zoneDefinitions[zoneNumber - 1];\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply Zone Analog Voltage Data\n *\n * @see 4.43.2 Reply Zone Analog Voltage Data (ZV)\n */\nexport default class ZoneVoltageData extends ElkResponse {\n  static readonly COMMAND = 'ZV';\n\n  readonly zoneNumber: number;\n  readonly zoneVoltage: number;\n\n  constructor(raw: string) {\n    super(raw);\n    this.zoneNumber = parseInt(this.data.substr(0, 3), 10);\n    this.zoneVoltage = parseInt(this.data.substr(3, 3), 10) / 10;\n  }\n}\n","import ElkResponse from './ElkResponse';\n\n/**\n * Reply Programming Of Insteon Lighting Device Data\n *\n * Note: Insteon Lighting Device 193 to 256 corresponds to\n * Insteon Groups 1 – 64.\n *\n * @see 4.44 Reply Programming Of Insteon Lighting Device Data (IP)\n */\nexport default class InsteonLightingDeviceProgrammed extends ElkResponse {\n  static readonly COMMAND = 'IP';\n\n  readonly startingDeviceNumber: number;\n  readonly deviceCount: number;\n\n  constructor(raw: string) {\n    super(raw);\n\n    this.startingDeviceNumber = parseInt(this.data.substr(0, 3), 10);\n    this.deviceCount = parseInt(this.data.substr(3, 1), 10);\n  }\n\n  get endingDeviceNumber() {\n    return this.startingDeviceNumber + this.deviceCount - 1;\n  }\n}\n","import ElkMessage from './ElkMessage';\nimport ElkResponse from './responses/ElkResponse';\nimport UnknownElkResponse from './responses/UnknownElkResponse';\nimport ArmingStatusReport from './responses/ArmingStatusReport';\nimport SendASCIIStringToIPAddress from './responses/SendASCIIStringToIPAddress';\nimport AlarmReport from './responses/AlarmReport';\nimport AlarmReportTest from './responses/AlarmReportTest';\nimport EthernetModuleTest from './responses/EthernetModuleTest';\nimport AlarmByZoneReport from './responses/AlarmByZoneReport';\nimport AudioDataReply from './responses/AudioDataReply';\nimport OutputChangeUpdate from './responses/OutputChangeUpdate';\nimport AudioCommandOutgoing from './responses/AudioCommandOutgoing';\nimport ControlOutputStatusReport from './responses/ControlOutputStatusReport';\nimport CustomValueReply from './responses/CustomValueReply';\nimport UserCodeChangeReply from './responses/UserCodeChangeReply';\nimport CounterValueReply from './responses/CounterValueReply';\nimport LightingDeviceDataReply from './responses/LightingDeviceDataReply';\nimport EntryExitTimer from './responses/EntryExitTimer';\nimport EmailSendTrigger from './responses/EmailSendTrigger';\nimport UserCodeEntry from './responses/UserCodeEntry';\nimport InstallerModeExited from './responses/InstallerModeExited';\nimport InsteonLightingDeviceStatusReply from './responses/InsteonLightingDeviceStatusReply';\nimport KeypadAreaAssignments from './responses/KeypadAreaAssignments';\nimport KeypadKeyChange from './responses/KeypadKeyChange';\nimport KeypadFunctionKeyPressReply from './responses/KeypadFunctionKeyPressReply';\nimport SystemLogDataUpdate from './responses/SystemLogDataUpdate';\nimport TemperatureData from './responses/TemperatureData';\nimport PlcChangeUpdate from './responses/PlcChangeUpdate';\nimport PlcDeviceStatusReply from './responses/PlcDeviceStatusReply';\nimport EthernetModuleReset from './responses/EthernetModuleReset';\nimport ElkRPConnected from './responses/ElkRPConnected';\nimport RealTimeClockDataReply from './responses/RealTimeClockDataReply';\nimport TextDescriptionReply from './responses/TextDescriptionReply';\nimport SystemTroubleStatusReply from './responses/SystemTroubleStatusReply';\nimport TemperatureReply from './responses/TemperatureReply';\nimport TaskChangeUpdate from './responses/TaskChangeUpdate';\nimport ThermostatData from './responses/ThermostatData';\nimport Omnistat2Reply from './responses/Omnistat2Reply';\nimport VersionNumberReply from './responses/VersionNumberReply';\nimport UserCodeAreasReply from './responses/UserCodeAreasReply';\nimport AlarmMemoryUpdate from './responses/AlarmMemoryUpdate';\nimport ZoneChangeUpdate from './responses/ZoneChangeUpdate';\nimport ZoneBypassReply from './responses/ZoneBypassReply';\nimport ZonePartitionReport from './responses/ZonePartitionReport';\nimport ZoneStatusReport from './responses/ZoneStatusReport';\nimport ZoneDefinitionData from './responses/ZoneDefinitionData';\nimport ZoneVoltageData from './responses/ZoneVoltageData';\nimport InsteonLightingDeviceProgrammed from './responses/InsteonLightingDeviceProgrammed';\n\nconst RESPONSE_MAP: { [index: string]: typeof ElkResponse } = {\n  [ArmingStatusReport.COMMAND]: ArmingStatusReport, // 4.2.13\n  [SendASCIIStringToIPAddress.COMMAND]: SendASCIIStringToIPAddress, // 4.2.13\n  [AlarmReport.COMMAND]: AlarmReport, // 4.4.1\n  [AlarmReportTest.COMMAND]: AlarmReportTest, // 4.4.3\n  [EthernetModuleTest.COMMAND]: EthernetModuleTest, // 4.4.5\n  [AlarmByZoneReport.COMMAND]: AlarmByZoneReport, // 4.5.1\n  [AudioDataReply.COMMAND]: AudioDataReply, // 4.6.2\n  [OutputChangeUpdate.COMMAND]: OutputChangeUpdate, // 4.7\n  [AudioCommandOutgoing.COMMAND]: AudioCommandOutgoing, // 4.8.3\n  [ControlOutputStatusReport.COMMAND]: ControlOutputStatusReport, // 4.9.4\n  [CustomValueReply.COMMAND]: CustomValueReply, // 4.10.3\n  [UserCodeChangeReply.COMMAND]: UserCodeChangeReply, // 4.11.2\n  [CounterValueReply.COMMAND]: CounterValueReply, // 4.12.3\n  [LightingDeviceDataReply.COMMAND]: LightingDeviceDataReply, // 4.14.2\n  [EntryExitTimer.COMMAND]: EntryExitTimer, // 4.15.1\n  [EmailSendTrigger.COMMAND]: EmailSendTrigger, // 4.16.1\n  [UserCodeEntry.COMMAND]: UserCodeEntry, // 4.17.1\n  [InstallerModeExited.COMMAND]: InstallerModeExited, // 4.18.1\n  [InsteonLightingDeviceStatusReply.COMMAND]: InsteonLightingDeviceStatusReply, // 4.19.4\n  [KeypadAreaAssignments.COMMAND]: KeypadAreaAssignments, // 4.20.2\n  [KeypadKeyChange.COMMAND]: KeypadKeyChange, // 4.21\n  [KeypadFunctionKeyPressReply.COMMAND]: KeypadFunctionKeyPressReply, // 4.22.2\n  [SystemLogDataUpdate.COMMAND]: SystemLogDataUpdate, // 4.23\n  [TemperatureData.COMMAND]: TemperatureData, // 4.24.2\n  [PlcChangeUpdate.COMMAND]: PlcChangeUpdate, // 4.25.2\n  [PlcDeviceStatusReply.COMMAND]: PlcDeviceStatusReply, // 4.25.6\n  [EthernetModuleReset.COMMAND]: EthernetModuleReset, // 4.26.1\n  [ElkRPConnected.COMMAND]: ElkRPConnected, // 4.27\n  [RealTimeClockDataReply.COMMAND]: RealTimeClockDataReply, // 4.28.2\n  [TextDescriptionReply.COMMAND]: TextDescriptionReply, // 4.29.2\n  [SystemTroubleStatusReply.COMMAND]: SystemTroubleStatusReply, // 4.30.2\n  [TemperatureReply.COMMAND]: TemperatureReply, // 4.31.2\n  [TaskChangeUpdate.COMMAND]: TaskChangeUpdate, // 4.33\n  [ThermostatData.COMMAND]: ThermostatData, // 4.35.2\n  [Omnistat2Reply.COMMAND]: Omnistat2Reply, // 4.35.5\n  [VersionNumberReply.COMMAND]: VersionNumberReply, // 4.36.2\n  [UserCodeAreasReply.COMMAND]: UserCodeAreasReply, // 4.37.2\n  [AlarmMemoryUpdate.COMMAND]: AlarmMemoryUpdate, // 4.38\n  [ZoneChangeUpdate.COMMAND]: ZoneChangeUpdate, // 4.39\n  [ZoneBypassReply.COMMAND]: ZoneBypassReply, // 4.40.2\n  [ZonePartitionReport.COMMAND]: ZonePartitionReport, // 4.40.4\n  [ZoneStatusReport.COMMAND]: ZoneStatusReport, // 4.40.6\n  [ZoneDefinitionData.COMMAND]: ZoneDefinitionData, // 4.41\n  [ZoneVoltageData.COMMAND]: ZoneVoltageData, // 4.43.2\n  [InsteonLightingDeviceProgrammed.COMMAND]: InsteonLightingDeviceProgrammed // 4.44\n};\n\nexport default function parse(raw: string): ElkMessage {\n  const command = raw.substr(2, 2);\n  const ResponseClass = RESPONSE_MAP[command] || UnknownElkResponse;\n  return new ResponseClass(raw);\n}\n","import ElkMessage from '../ElkMessage';\nimport numberToHex from '../../util/numberToHex';\nimport calculateChecksum from '../../util/calculateChecksum';\nimport { PACKET_LENGTH_WIDTH, RESERVED_DEFAULT, TERMINATOR } from '../constants';\n\n/**\n * A message that is sent to the Elk M1\n */\nexport default abstract class ElkCommand implements ElkMessage {\n  constructor(\n    readonly messageType: string,\n    readonly subMessageType: string,\n    readonly data: string = ''\n  ) {}\n\n  get raw(): string {\n    const message = `${this.command}${this.data || ''}${this.reserved || RESERVED_DEFAULT}`;\n    const packetLength = numberToHex(message.length + 2, PACKET_LENGTH_WIDTH);\n    const checksum = calculateChecksum(`${packetLength}${message}`);\n    return `${packetLength}${message}${checksum}${TERMINATOR}`;\n  }\n\n  get command(): string {\n    return this.messageType + this.subMessageType;\n  }\n\n  get reserved(): string {\n    return RESERVED_DEFAULT;\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * 4.5 Alarm By Zone Request (az)\n *\n * Request alarm by zone\n *\n * The control panel responds to this message with a\n * {@link AlarmByZoneReport}\n */\nexport default class AlarmByZoneRequest extends ElkCommand {\n  constructor() {\n    super('a', 'z');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Alarm Report Acknowledge\n *\n * The Ethernet Module (M1XEP) will acknowledge the M1’s Alarm Report\n * transmission with the reply: 06ar0067<cr><lf>. This acknowledge\n * is sent to the M1 only if the central station’s server acknowledges\n * the Ethernet Module’s data packet.\n *\n * @see 4.4.2 Alarm Report Acknowledge (ar)\n */\nexport default class AlarmReportAcknowledge extends ElkCommand {\n  constructor() {\n    super('a', 'r');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Alarm Reporting Test Acknowledge\n *\n * If the Alarm Reporting Test if successful to the central station’s IP\n * address the Acknowledge message will be sent to the M1 from the\n * M1XEP: 06at0065<cr><lf>.\n *\n * @see 4.4.4 Alarm Reporting Test Acknowledge (at)\n */\nexport default class AlarmReportTestAcknowledge extends ElkCommand {\n  constructor() {\n    super('a', 't');\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport ArmingLevel from '../../enums/ArmingLevel';\n\n/**\n * Arm or disarm an area.\n *\n * Note: Arming the control panel with zones open\n * will initiate “force arming” regardless of whether\n * force arming is enabled or disabled in the control panel.\n *\n * @see 4.2 Arm and Disarm Messages (a0..a8)\n */\nexport default class Arm extends ElkCommand {\n  /**\n   * @param armingLevel The arming level desired\n   * @param areaNumber The area to be armed or disarmed\n   * @param userCode The user code (a string of 4 or 6 digits)\n   */\n  constructor(\n    readonly armingLevel: ArmingLevel,\n    readonly areaNumber: number,\n    readonly userCode: string\n  ) {\n    super('a', String.fromCharCode(armingLevel), areaNumber + userCode.padStart(6, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Requests current arming status for all areas.\n *\n * The control panel responds to this message with a {@link ArmingStatusReport}\n *\n * @see 4.2.12 Arming Status Request (as)\n */\nexport default class ArmingStatusRequest extends ElkCommand {\n  constructor() {\n    super('a', 's');\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport AudioCommand from '../../enums/AudioCommand';\n\n/**\n * Incoming Audio Command\n *\n * An M1XEP Ethernet Module is required to intercept the “cd” command.\n * These commands are sent into the M1XEP via the Ethernet connection\n * and passed through to the M1. The M1XEP builds custom audio commands\n * to control the audio equipment and sends these commands to the audio\n * equipment via ethernet. An IP232 Ethernet Module may be required at\n * the audio equipment to received the commands if no Ethernet Port is\n * available on the audio equipment. The incoming “cd” command can\n * trigger Rules in the M1 which can fire outgoing audio equipment\n * “CD” commands or other control Rules. ELKRP downloads the Audio\n * Equipment Command tables into the M1XEP according to the Audio\n * Equipment Manufacturer. M1 version 4.1.11, 5.1.11 or later is required.\n *\n * @see 4.8.1 Incoming Audio Command (cd)\n */\nexport default class AudioCommandIncoming extends ElkCommand {\n  constructor(\n    readonly audioCommand: AudioCommand,\n    readonly audioSource: number,\n    readonly audioZone: number,\n    readonly value: number = 0\n  ) {\n    super(\n      'c',\n      'd',\n      audioCommand.toString().padStart(2, '0') +\n        audioSource.toString().padStart(2, '0') +\n        audioZone.toString().padStart(2, '0') +\n        value.toString().padStart(3, '0')\n    );\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Audio Data\n *\n * The control panel responds to this message with a {@link AudioDataReply}\n *\n * @see 4.6.1 Request Audio Data (ca)\n */\nexport default class AudioDataRequest extends ElkCommand {\n  constructor(readonly zoneNumber: number) {\n    super('c', 'a', zoneNumber.toString().padStart(2, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Control Output off\n *\n * @see 4.9.1 Control Output off (cf)\n */\nexport default class ControlOutputOff extends ElkCommand {\n  constructor(readonly output: number) {\n    super('c', 'f', output.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Control Output On\n *\n * @see 4.9.2 Control Output On (cn)\n */\nexport default class ControlOutputOn extends ElkCommand {\n  constructor(readonly output: number, readonly duration: number = 0) {\n    super('c', 'n', output.toString().padStart(3, '0') + duration.toString().padStart(5, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Control Output Status Request\n *\n * The control panel responds with a {@link ControlOutputStatusReport} Report for all 208 outputs.\n *\n * @see 4.9.3 Control Output Status Request (cs)\n */\nexport default class ControlOutputStatusRequest extends ElkCommand {\n  constructor() {\n    super('c', 's');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Control Output toggle\n *\n * @see 4.9.5 Control Output toggle (ct)\n */\nexport default class ControlOutputToggle extends ElkCommand {\n  constructor(readonly output: number) {\n    super('c', 't', output.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Read Counter Value\n *\n * The control responds with {@link CounterValueReply}\n *\n * @see 4.12.1 Read Counter Value (cv)\n */\nexport default class CounterValueRead extends ElkCommand {\n  constructor(readonly counterNumber: number) {\n    super('c', 'v', counterNumber.toString().padStart(2, '0'));\n\n    if (counterNumber < 1 || counterNumber > 64) {\n      throw new RangeError('Counter value number must be between 1 and 64');\n    }\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Write Counter Value\n *\n * @see 4.12.2 Write Counter Value (cx)\n */\nexport default class CounterValueWrite extends ElkCommand {\n  constructor(readonly counterNumber: number, readonly value: number) {\n    super('c', 'x', counterNumber.toString().padStart(2, '0') + value.toString().padStart(5, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Read Custom Value\n *\n * The control response with {@link CustomValueReply}\n *\n * @see 4.10.1 Read Custom Value (cr)\n */\nexport default class CustomValueRead extends ElkCommand {\n  constructor(readonly valueNumber: number) {\n    super('c', 'r', valueNumber.toString().padStart(2, '0'));\n\n    if (valueNumber < 0 || valueNumber > 20) {\n      throw new RangeError('Custom value number must be between 0 and 20');\n    }\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport CustomValue from '../../models/CustomValue';\n\n/**\n * Write Custom Value\n *\n * @see 4.10.5 Write Custom Value (cw)\n */\nexport default class CustomValueWrite extends ElkCommand {\n  constructor(readonly valueNumber: number, readonly value: CustomValue) {\n    super('c', 'w', valueNumber.toString().padStart(2, '0') + value.encode());\n\n    if (valueNumber < 0 || valueNumber > 20) {\n      throw new RangeError('Custom value number must be between 0 and 20');\n    }\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Read ALL Custom Values\n *\n * The control response with {@link CustomValueReply}\n *\n * @see 4.10.2 Read ALL Custom Values (cp)\n */\nexport default class CustomValuesReadAll extends ElkCommand {\n  constructor() {\n    super('c', 'p');\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport DisplayTextClearOption from '../../enums/DisplayTextClearOption';\n\nexport function encodeLineData(input?: string | null) {\n  // If there is no data, return the terminator and pad with dummy character.\n  if (!input || !input.length) {\n    return '^'.padEnd(16, 'x');\n  }\n\n  // If the input is less then the allowed length, add the terminator character\n  // and pad with dummy characters.\n  if (input.length < 16) {\n    return (input + '^').padEnd(16, 'x');\n  }\n\n  // Otherwise, make sure the input is limited to 16 characters.\n  return input.substr(0, 16);\n}\n\n/**\n * Display Text On LCD Screen of keypads\n *\n * This is a M1 received message to display ascii text on the bottom line\n * of the LCD display on the keypads in the area specified. Enter the line\n * terminator, “^”, as the ending character of the line display if less\n * than 16 characters are to be displayed. The message line, L1 or L2,\n * will need dummy characters to fill the rest of the line for 16\n * characters each line.\n *\n * @see 4.13 Display Text On LCD Screen (dm)\n */\nexport default class DisplayTextOnScreen extends ElkCommand {\n  constructor(\n    readonly areaNumber: number,\n    readonly firstLine: string | null = '',\n    readonly secondLine: string | null = '',\n    readonly clearOption: DisplayTextClearOption = !firstLine\n      ? DisplayTextClearOption.Clear\n      : DisplayTextClearOption.ClearWithStarKey,\n    readonly beep: boolean = true,\n    readonly timeout: number = 0\n  ) {\n    super(\n      'd',\n      'm',\n      areaNumber.toString() +\n        clearOption.toString() +\n        (beep ? '1' : '0') +\n        (timeout || 0).toString().padStart(5, '0') +\n        encodeLineData(firstLine) +\n        encodeLineData(secondLine)\n    );\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Ethernet Module Test Acknowledge\n *\n * If the Ethernet Module is alive, it will reply back to the M1\n * with: 06xk0057<cr><lf>.\n *\n * @see 4.4.6 Ethernet Module Test Acknowledge (xk)\n */\nexport default class EthernetModuleTestAcknowledge extends ElkCommand {\n  constructor() {\n    super('x', 'k');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Programming Of Insteon Lighting Device Data\n *\n * @see 4.19.5 Request Programming Of Insteon Lighting Device Data (ip)\n */\nexport default class InsteonLightingDeviceProgramRequest extends ElkCommand {\n  constructor(readonly startingDeviceNumber: number, readonly deviceIds: string[]) {\n    super(\n      'i',\n      'p',\n      startingDeviceNumber.toString().padStart(3, '0') +\n        deviceIds.length.toString() +\n        deviceIds.map(id => id.padStart(6, '0')).join('')\n    );\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Read Of Insteon Lighting Device Data\n *\n * This command allows the M1 to poll single light devices to obtain\n * their on, off, dim status. This will be an automatic command issued\n * from the M1 to the M1XSP Type modules that connect to lighting devices.\n * Note: Only single light devices can be polled for status. Groups and\n * scenes will not return valid data. Enable the “2 Way” Poll setting for\n * the device to be polled. M1 Version 4.3.9 and after. This command\n * cannot be used by automation equipment.\n *\n * @see 4.19.3 Request Read Of Insteon Lighting Device Data (ir)\n */\nexport default class InsteonLightingDeviceStatusRequest extends ElkCommand {\n  constructor(readonly startingDeviceNumber: number, readonly deviceCount: number) {\n    super('i', 'r', startingDeviceNumber.toString().padStart(3, '0') + deviceCount.toString());\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Keypad Area Assignment\n *\n * This request command allows automation equipment to request\n * the Areas that all keypads are assigned to. The return string\n * contains a 16 byte array with keypad 1’s area at array index\n * 0 and keypad 15’s area in array index 15. M1 Version 4.2.5 and after.\n *\n * @see 4.20.1 Request Keypad Area Assignment (ka)\n */\nexport default class KeypadAreaAssigmentsRequest extends ElkCommand {\n  constructor() {\n    super('k', 'a');\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport FunctionKey from '../../enums/FunctionKey';\n\n/**\n * Request Keypad Function Key Press\n *\n * This command simulates a function key being pressed on a keypad.\n * This will only be single key press even if the M1 Control is\n * programmed for double function key press. M1 Version 4.2.5 and\n * after.\n *\n * SilenceTroubleBeep (‘*’) key: M1 Version 4.2.6 and after\n * Chime (‘C’) key: M1 Version 4.3.2 and after.\n *\n * @see 4.22.1 Request Keypad Function Key Press (kf)\n */\nexport default class KeypadFunctionKeyPressRequest extends ElkCommand {\n  constructor(readonly keypadNumber: number, readonly functionKey: FunctionKey = FunctionKey.None) {\n    super('k', 'f', keypadNumber.toString().padStart(2, '0') + String.fromCharCode(functionKey));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Keypad Function Key Illumination Status\n *\n * The function key illumination request returns the Keypad KeyChange\n * Update (KC) data with the Key Number set to zero (0). This command\n * allows automation equipment to request the illumination status of\n * the keypad function keys for building virtual keypads on a PC.\n *\n * @see 4.21.1 Request Keypad Function Key Illumination Status (kc)\n */\nexport default class KeypadFunctionKeyStatusRequest extends ElkCommand {\n  constructor(readonly keypadNumber: number) {\n    super('k', 'c', keypadNumber.toString().padStart(2, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Lighting Device Status\n *\n * This command allows the M1 to poll single light devices to obtain\n * their on, off, dim status. This will be an automatic command issued\n * from the M1 to the M1XSP Type modules that connect to lighting devices.\n * Note: Only single light devices can be polled for status. Groups and\n * scenes will not return valid data. Enable the “2 Way” Poll setting for\n * the device to be polled. M1 Version 4.3.9 and after. This command\n * cannot be used by automation equipment.\n *\n * @see 4.14.1 Request Lighting Device Status (ds)\n */\nexport default class LightingDeviceStatusRequest extends ElkCommand {\n  constructor(readonly lightingDeviceNumber: number) {\n    super('d', 's', lightingDeviceNumber.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request - Omnistat 2 From PC to M1 ASCII Protocol\n *\n * This request command allows for requesting data from the M1XSP that\n * is connected to the HAI Omnistate 2 HVAC Thermostat. The Omnistat 2\n * protocol is required to build the ASCII command strings. M1 version\n * 5.1.9 or later is required for this command.\n *\n * @see 4.35.4 Request - Omnistat 2 From PC to M1 ASCII Protocol (t2)\n */\nexport default class Omnistat2Request extends ElkCommand {\n  constructor(readonly omnistatData: string) {\n    super('t', '2', omnistatData.padEnd(36, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport PlcFunctionCode from '../../enums/PlcFunctionCode';\n\n/**\n * Control Any PLC Device\n *\n * @see 4.25.1 Control Any PLC Device (pc)\n */\nexport default class PlcDeviceControl extends ElkCommand {\n  constructor(\n    readonly houseCode: string,\n    readonly unitCode: number,\n    readonly functionCode: PlcFunctionCode,\n    readonly extendedCode: number,\n    readonly onTime: number\n  ) {\n    super(\n      'p',\n      'c',\n      houseCode +\n        unitCode.toString().padStart(2, '0') +\n        functionCode.toString().padStart(2, '0') +\n        extendedCode.toString().padStart(2, '0') +\n        onTime.toString().padStart(4, '0')\n    );\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Turn OFF PLC Device\n *\n * @see 4.25.3 Turn OFF PLC Device (pf)\n */\nexport default class PlcDeviceOff extends ElkCommand {\n  constructor(readonly houseCode: string, readonly unitCode: number) {\n    super('p', 'f', houseCode + unitCode.toString().padStart(2, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Turn ON PLC Device\n *\n * @see 4.25.4 Turn ON PLC Device (pn)\n */\nexport default class PlcDeviceOn extends ElkCommand {\n  constructor(readonly houseCode: string, readonly unitCode: number) {\n    super('p', 'n', houseCode + unitCode.toString().padStart(2, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request PLC status\n *\n * @see 4.25.5 Request PLC status (ps)\n */\nexport default class PlcDeviceStatusRequest extends ElkCommand {\n  constructor(readonly bank: number) {\n    super('p', 's', bank.toString());\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Toggle PLC Device\n *\n * @see 4.25.7 Toggle PLC Device (pt)\n */\nexport default class PlcDeviceToggle extends ElkCommand {\n  constructor(readonly houseCode: string, readonly unitCode: number) {\n    super('p', 't', houseCode + unitCode.toString().padStart(2, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Real Time Clock Data\n *\n * @see 4.28.1 Request Real Time Clock Data (rr)\n */\nexport default class RealTimeClockDataRequest extends ElkCommand {\n  constructor() {\n    super('r', 'r');\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport DayOfWeek from '../../enums/DayOfWeek';\nimport MonthOfYear from '../../enums/MonthOfYear';\n\n/**\n * Write Real Time Clock Data\n *\n * @see 4.28.3 Write Real Time Clock Data (rw)\n */\nexport default class RealTimeClockDataWrite extends ElkCommand {\n  constructor(\n    readonly year: number,\n    readonly month: MonthOfYear,\n    readonly day: number,\n    readonly dayOfWeek: DayOfWeek,\n    readonly hour: number,\n    readonly minutes: number,\n    readonly seconds: number\n  ) {\n    super(\n      'r',\n      'w',\n      seconds.toString().padStart(2, '0') +\n        minutes.toString().padStart(2, '0') +\n        hour.toString().padStart(2, '0') +\n        dayOfWeek.toString() +\n        day.toString().padStart(2, '0') +\n        month.toString().padStart(2, '0') +\n        year\n          .toString()\n          .padStart(2, '0')\n          .substr(-2)\n    );\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Speak Phrase at Voice/Siren Output\n *\n * @see 4.32.2 Speak Phrase at Voice/Siren Output (sp)\n */\nexport default class SpeakPhrase extends ElkCommand {\n  constructor(readonly phraseNumber: number) {\n    super('s', 'p', phraseNumber.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Speak Word at Voice/Siren Output\n *\n * @see 4.32.1 Speak Word at Voice/Siren Output (sw)\n */\nexport default class SpeakWord extends ElkCommand {\n  constructor(readonly wordNumber: number) {\n    super('s', 'w', wordNumber.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request System Log Data\n *\n * Request to get system log data entry. The first entry is\n * index “1”, the last entry is index “511”. Log data index\n * “0” is the next location to be written, index 511 is\n * the oldest log data.\n *\n * @see 4.23.1 Request System Log Data (ld)\n */\nexport default class SystemLogDataReadRequest extends ElkCommand {\n  constructor(readonly logIndex: number) {\n    super('l', 'd', logIndex.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport LogWriteType from '../../enums/LogWriteType';\n\n/**\n * Request Write Log Data\n *\n * The Write Log Data Command “le” writes log data into the\n * M1 log specifically to trigger communicator reporting to\n * the central station. A valid zone must be programmed for\n * communicator reporting. The M1 will return an “OK”crlf\n * response when the data is written to the log.\n *\n * @see 4.23.2 Request Write Log Data (le)\n */\nexport default class SystemLogDataWriteRequest extends ElkCommand {\n  constructor(\n    readonly logType: LogWriteType,\n    readonly eventType: number,\n    readonly zoneNumber: number,\n    readonly areaNumber: number\n  ) {\n    super(\n      'l',\n      'e',\n      logType.toString().padStart(3, '0') +\n        eventType\n          .toString()\n          .padStart(4, '0')\n          .substr(-3) +\n        zoneNumber.toString().padStart(3, '0') +\n        areaNumber.toString()\n    );\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request System Trouble Status\n *\n * This command allows automation equipment to poll for\n * system trouble status. Firmware revision 4.5.4, 5.1.4\n * and after. This message will automatically be sent\n * upon a trouble status change.\n *\n * @see 4.30.1 Request System Trouble Status (ss)\n */\nexport default class SystemTroubleStatusRequest extends ElkCommand {\n  constructor() {\n    super('s', 's');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Task Activation\n *\n * You can use your PC to send a command to activate a Task. Tasks\n * are event flags that are common to the telephone remote control\n * option 2, the keypad user menu option 1, the Whenever/Then\n * programming, and the ASCII string programming. Any one of these\n * methods can activate a Task (events 2001 to 2032). The\n * Whenever/Then programming rules can then issue control commands\n * when a Task has been activated. When all rules that are activated\n * from the Task is serviced, the Task will be de-activated.\n *\n * The data portion of the Task Activation command, DDD, is three\n * decimal ASCII digits (1 base) corresponding to the number of the\n * desired Task to activate. Range: 001 to 032. This value is a three\n * digit value for future expansion.\n *\n * @see 4.34 Task Activation (tn)\n */\nexport default class TaskActivation extends ElkCommand {\n  constructor(readonly taskNumber: number) {\n    super('t', 'n', taskNumber.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Temperature Data\n *\n * This command allows automation equipment to request\n * the temperatures from zone temperature sensors and\n * keypad temperatures in one ASCII packet.\n * M1 Version 4.3.4 andafter.\n *\n * @see 4.24.1 Request Temperature Data (lw)\n */\nexport default class TemperatureDataRequest extends ElkCommand {\n  constructor() {\n    super('l', 'w');\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport TemperatureDeviceType from '../../enums/TemperatureDeviceType';\n\n/**\n * Request Temperature format\n *\n * This request command allows automation equipment to read\n * temperatures of the temperature probes connected to zones\n * 1 to 16, Keypad temperature from the sensor in each LCD\n * keypad, and Thermostat temperatures. Each Group can have\n * up to 16 temperature sensors.\n *\n * Version 4.2.8 and later sends automatic temperature updates\n * out Port 0 when any temperature device parameter changes.\n *\n * @see 4.31.1 Request Temperature format (st)\n */\nexport default class TemperatureRequest extends ElkCommand {\n  constructor(readonly deviceType: TemperatureDeviceType, readonly deviceNumber: number) {\n    super('s', 't', deviceType.toString() + deviceNumber.toString().padStart(2, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport TextDescriptionType from '../../enums/TextDescriptionType';\n\n/**\n * Request ASCII String Text Descriptions\n *\n * This request command allows automation equipment to read\n * the text descriptions that are stored in the control.\n *\n * The control will response with a {@link TextDescriptionResponse}.\n *\n * NOTE! The {@link TextDescriptionResponse} may not be for the\n * `address` requested! If there is no description for the requested\n * address the next addresses will be searched until one with a\n * description is found (or, if none are found, an address of `0` will\n * be returned).\n *\n * From the protocol specification:\n * > If the first character in a requested name is a “space” or less,\n * > then the next names are searched until a name is found whose first\n * > character is greater than “space” or the “Show On Keypad” bit is\n * > set. If no valid names are found, a “000” for the NNN address is\n * > returned. This speeds up the loading of names so that invalid\n * > names are not returned. M1 version 2.4.6 or later.\n *\n * @see 4.29.1 Request ASCII String Text Descriptions (sd)\n */\nexport default class TextDescriptionRequest extends ElkCommand {\n  constructor(readonly textType: TextDescriptionType, readonly address: number) {\n    super('s', 'd', textType.toString().padStart(2, '0') + address.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Thermostat Data\n *\n * This command allows automation equipment to monitor and control\n * HVAC Thermostats connected to the M1. All temperature settings\n * are expressed in ASCII Decimal, two digits. M1 Version 4.2.6 and after.\n *\n * @see 4.35.1 Request Thermostat Data (tr)\n */\nexport default class ThermostatDataRequest extends ElkCommand {\n  constructor(readonly thermostatNumber: number) {\n    super('t', 'r', thermostatNumber.toString().padStart(2, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport ThermostatSetType from '../../enums/ThermostatSetType';\n\n/**\n * Set Thermostat Data\n *\n * @see 4.35.3 Set Thermostat Data (ts)\n */\nexport default class ThermostatSet extends ElkCommand {\n  constructor(\n    readonly thermostatNumber: number,\n    readonly value: number,\n    readonly element: ThermostatSetType\n  ) {\n    super(\n      't',\n      's',\n      thermostatNumber.toString().padStart(2, '0') +\n        value.toString().padStart(2, '0') +\n        element.toString()\n    );\n  }\n}\n","import ThermostatSet from './ThermostatSet';\nimport ThermostatSetType from '../../enums/ThermostatSetType';\n\n/**\n * Set Thermostat Data\n *\n * @see 4.35.3 Set Thermostat Data (ts)\n */\nexport default class ThermostatSetCoolSetPoint extends ThermostatSet {\n  constructor(thermostatNumber: number, readonly temperature: number) {\n    super(thermostatNumber, temperature, ThermostatSetType.CoolSetPoint);\n  }\n}\n","import ThermostatSet from './ThermostatSet';\nimport ThermostatSetType from '../../enums/ThermostatSetType';\n\n/**\n * Set Thermostat Data\n *\n * @see 4.35.3 Set Thermostat Data (ts)\n */\nexport default class ThermostatSetFan extends ThermostatSet {\n  constructor(thermostatNumber: number, readonly isOn: boolean) {\n    super(thermostatNumber, isOn ? 1 : 0, ThermostatSetType.Fan);\n  }\n}\n","import ThermostatSet from './ThermostatSet';\nimport ThermostatSetType from '../../enums/ThermostatSetType';\n\n/**\n * Set Thermostat Data\n *\n * @see 4.35.3 Set Thermostat Data (ts)\n */\nexport default class ThermostatSetHeatSetPoint extends ThermostatSet {\n  constructor(thermostatNumber: number, readonly temperature: number) {\n    super(thermostatNumber, temperature, ThermostatSetType.HeatSetPoint);\n  }\n}\n","import ThermostatSet from './ThermostatSet';\nimport ThermostatSetType from '../../enums/ThermostatSetType';\n\n/**\n * Set Thermostat Data\n *\n * @see 4.35.3 Set Thermostat Data (ts)\n */\nexport default class ThermostatSetHold extends ThermostatSet {\n  constructor(thermostatNumber: number, readonly isOn: boolean) {\n    super(thermostatNumber, isOn ? 1 : 0, ThermostatSetType.Hold);\n  }\n}\n","import ThermostatSet from './ThermostatSet';\nimport ThermostatMode from '../../enums/ThermostatMode';\nimport ThermostatSetType from '../../enums/ThermostatSetType';\n\n/**\n * Set Thermostat Data\n *\n * @see 4.35.3 Set Thermostat Data (ts)\n */\nexport default class ThermostatSetMode extends ThermostatSet {\n  constructor(thermostatNumber: number, readonly mode: ThermostatMode) {\n    super(thermostatNumber, mode - 48, ThermostatSetType.Mode);\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Valid User Code Areas\n *\n * This request command allows automation equipment to send a\n * user code to the control and have returned what areas the\n * code is valid in. The returned value is an 8 bit masked value\n * with bit 0 corresponding to area 1, up to bit 7 corresponding\n * to area 8. If the returned value is 0, then the code is not valid\n * in any area. M1 Version 4.2.5 , type of code is in Version 4.3.6\n * and after.\n *\n * @see 4.37.1 Request Valid User Code Areas (ua)\n */\nexport default class UserCodeAreasRequest extends ElkCommand {\n  constructor(readonly userCode: string) {\n    super('u', 'a', userCode.padStart(6, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\nimport UserCode from '../../models/UserCode';\nimport { RESERVED_DEFAULT } from '../constants';\nimport UserCodeChangeType from '../../enums/UserCodeChangeType';\n\n/**\n * Encodes selected area numbers.\n *\n * Two ASCII Hex characters, 0-9,A-F, using the Hex value of each\n * character as the mask for 4 areas. Right most character is\n * areas 1 to 4 with bit 0 equal to Area 1.\n *\n * @param areaNumbers An array of area numbers to encode\n * @return {string} The area numbers encoded as hex.\n */\nexport function encodeAreaNumbers(areaNumbers?: number[]) {\n  if (!areaNumbers || !areaNumbers.length) {\n    return '00';\n  }\n\n  // Start with an array of all 0s, replacing any area numbers with 1's.\n  const bitValues = areaNumbers\n    .reduce(\n      (bits, areaNumber) =>\n        bits\n          .slice(0, areaNumber - 1)\n          .concat(1)\n          .concat(bits.slice(areaNumber)),\n      [0, 0, 0, 0, 0, 0, 0, 0]\n    )\n    .reverse(); // reverse: bit 0 = area 1, etc.\n\n  // Join them as a single string and parse them as a binary number,\n  // then convert them to a 2-character hex string.\n  return parseInt(bitValues.join(''), 2)\n    .toString(16)\n    .padStart(2, '0')\n    .toUpperCase();\n}\n\nfunction generateData(\n  userNumber: number,\n  masterOrCurrentUserCode: string | UserCode,\n  newUserCode: string | UserCode,\n  areaNumbers?: number[]\n) {\n  const authCode =\n    typeof masterOrCurrentUserCode === 'string'\n      ? new UserCode(masterOrCurrentUserCode)\n      : masterOrCurrentUserCode;\n  const newCode = typeof newUserCode === 'string' ? new UserCode(newUserCode) : newUserCode;\n  return (\n    userNumber.toString().padStart(3, '0') +\n    authCode.encode() +\n    newCode.encode() +\n    encodeAreaNumbers(areaNumbers)\n  );\n}\n\n/**\n * Request Change User Code\n *\n * This command allows automation equipment to change a user code. The\n * data packet must include a Master User Code or the current user code\n * of the user code to be changed. 4.3.9 and after.\n *\n * @see 4.11.1 Request Change User Code (cu)\n */\nexport default class UserCodeChangeRequest extends ElkCommand {\n  readonly newUserCode: UserCode;\n  readonly authorizationUserCode: UserCode;\n\n  constructor(\n    readonly userNumber: number,\n    masterOrCurrentUserCode: string | UserCode,\n    newUserCode: string | UserCode,\n    readonly areaNumbers?: number[],\n    readonly changeType: UserCodeChangeType = UserCodeChangeType.UserCode\n  ) {\n    super('c', 'u', generateData(userNumber, masterOrCurrentUserCode, newUserCode, areaNumbers));\n    this.authorizationUserCode =\n      typeof masterOrCurrentUserCode === 'string'\n        ? new UserCode(masterOrCurrentUserCode)\n        : masterOrCurrentUserCode;\n    this.newUserCode = typeof newUserCode === 'string' ? new UserCode(newUserCode) : newUserCode;\n  }\n\n  get reserved(): string {\n    return this.changeType.toString() + '0';\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request M1 Version Number\n *\n * The vn command requests the M1’s version number,\n * and the VN command replies with the version number\n * data. If an M1XEP is connected to the M1, the M1XEP’s\n * version number will also be included. Available in M1\n * version 4.1.12 or 5.1.12 and later. M1XEP 1.3.2 or later.\n *\n * @see 4.36.1 Request M1 Version Number (vn)\n */\nexport default class VersionNumberRequest extends ElkCommand {\n  constructor() {\n    super('v', 'n');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Zone Bypass Request\n *\n * This command allows for bypassing/unbypassing a zone.\n * Zone = 000 will unbypass all burglar zones in the.\n * Zone = 999 will bypass all violated burglar zones.\n * Area to bypass/unbypass is required if Zone equals\n * 000 or 999 otherwise it is ignored.\n *\n * @see 4.40.1 Zone Bypass Request (zb)\n */\nexport default class ZoneBypassRequest extends ElkCommand {\n  constructor(\n    readonly pinCode: string,\n    readonly zoneNumber: number,\n    readonly areaNumber: number = 0\n  ) {\n    super(\n      'z',\n      'b',\n      zoneNumber.toString().padStart(3, '0') + areaNumber.toString() + pinCode.padStart(6, '0')\n    );\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Zone Definition\n *\n * This command allows automation equipment to request the\n * zone definitions. 4.2.6 and after.\n *\n * @see 4.41.1 Request Zone Definition (zd)\n */\nexport default class ZoneDefinitionRequest extends ElkCommand {\n  constructor() {\n    super('z', 'd');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Zone Partition Request\n *\n * The Control panel responds with a {@link ZonePartitionReport}\n * which tells what Area is assigned to each zone.\n *\n * @see 4.40.3 Zone Partition Request (zp)\n */\nexport default class ZonePartitionRequest extends ElkCommand {\n  constructor() {\n    super('z', 'p');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Zone Status Request\n *\n * The control panel responds with a {@link ZoneStatusReport}.\n *\n * Note: This message should be sent only when an initial\n * connection is made with the control panel. It is not\n * intended to be used as a ‘polling’ command. The control\n * panel can be programmed to send zone and system status\n * messages whenever the status changes with Global Programming\n * Location 33 – 37 in the M1 Control.\n *\n * @see 4.40.5 Zone Status Request (zs)\n */\nexport default class ZoneStatusRequest extends ElkCommand {\n  constructor() {\n    super('z', 's');\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Zone Trigger\n *\n * This command allows a 3rd party integration device to trigger\n * an alarm condition on a EOL hardwired zone defined with any\n * of the Burglary zone types and many other zone types up to\n * zone type 26. This command creates a virtual momentary open\n * condition on the zone as if the EOL hardwired loop had been\n * physically opened. This requires M1 Version 4.5.23, 5.1.23\n * or later. Caution: This command cannot create a virtual short\n * condition and therefore cannot trigger an alarm condition for\n * zone types that require a short. i.e. Fire zone alarms cannot\n * be triggered.\n *\n * @see 4.42.1 Zone Trigger (zt)\n */\nexport default class ZoneTrigger extends ElkCommand {\n  constructor(readonly zoneNumber: number) {\n    super('z', 't', zoneNumber.toString().padStart(3, '0'));\n  }\n}\n","import ElkCommand from './ElkCommand';\n\n/**\n * Request Zone Voltage\n *\n * This command allows automation equipment to request a\n * zone analog voltage level. M1 Version 4.2.8 and after.\n *\n * @see 4.43.1 Request Zone Voltage (zv)\n */\nexport default class ZoneVoltageRequest extends ElkCommand {\n  constructor(readonly zoneNumber: number) {\n    super('z', 'v', zoneNumber.toString().padStart(3, '0'));\n  }\n}\n"]}