-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbase.js
32 lines (27 loc) · 879 Bytes
/
base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class AlarmZone {
constructor (zoneID, name, description) {
this.zoneID = zoneID;
this.name = name;
this.description = description;
this.faulted = false;
}
}
class AlarmBase {
constructor (log) {
this.state = null;
this.log = log;
this.alarmZones = []; //used to hold all AlarmDecoderZones, which reference a zone accessory
}
async getAlarmState() {
throw 'must implement function updating alarm system state and state of all zones';
}
async setAlarmState(state) {
this.state = state; //clears linter error
throw 'must implement function updating alarm system state';
}
async initZones() {
throw 'must implement functions to populate Zones with AlarmDecoderZone(s)';
}
}
module.exports.AlarmZone = AlarmZone;
module.exports.AlarmBase = AlarmBase;