Add watch trigger to set CCTVs HomeMode dependiong on the status of the residents
This commit is contained in:
@@ -137,6 +137,18 @@ class Car extends Equipment {
|
||||
class CCTV extends Equipment {
|
||||
constructor(equipmentItem) {
|
||||
super(equipmentItem);
|
||||
|
||||
// Watch
|
||||
this.watch['AP_ResidentsAreHome'] = new watch.Watch('AP_ResidentsAreHome');
|
||||
this.watch['AP_ResidentsAreHome'].add({
|
||||
targetState: 'ON',
|
||||
alertFunc: () => { this.setHomeMode('ON'); }
|
||||
});
|
||||
this.watch['AP_ResidentsAreHome'].add({
|
||||
targetState: 'OFF',
|
||||
alertFunc: () => { this.setHomeMode('OFF'); },
|
||||
alertDelay: 'PT1M'
|
||||
});
|
||||
}
|
||||
|
||||
setHomeMode(mode) {
|
||||
|
||||
Reference in New Issue
Block a user