1
0

Add watch trigger to set CCTVs HomeMode dependiong on the status of the residents

This commit is contained in:
2024-01-01 17:54:56 +01:00
parent 362f11dc03
commit 7fe3b31eef

View File

@@ -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) {