1
0

Add Unreach monitoring

This commit is contained in:
2023-08-16 16:37:44 +02:00
parent 3ca6d7ad83
commit ca1213d204

View File

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