Add Unreach monitoring
This commit is contained in:
@@ -37,6 +37,17 @@ class Equipment {
|
||||
alertRepeat: 'PT23H'
|
||||
});
|
||||
}
|
||||
|
||||
// Check if equipment has Unreach item
|
||||
if (this.hasProperty('Unreach')) {
|
||||
this.watch['Unreach'] = new watch.Watch(this.getPropertyItemName('Unreach'));
|
||||
this.watch['Unreach'].add({
|
||||
targetState: 'ON',
|
||||
alertFunc: () => { this.#notifyUnreach(); },
|
||||
alertDelay: 'PT15M',
|
||||
alertRepeat: 'PT1H'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
getValue(propertyName, defaultValue = '') {
|
||||
@@ -79,6 +90,10 @@ class Equipment {
|
||||
console.warn(`${this.name} has a low battery level.`);
|
||||
}
|
||||
|
||||
#notifyUnreach() {
|
||||
console.warn(`${this.name} is offline.`);
|
||||
}
|
||||
|
||||
gc() {
|
||||
console.log('Denitialization of eqipment ' + this.name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user