refactoring

This commit is contained in:
Wolfgang Hottgenroth
2018-01-04 23:07:21 +01:00
parent 6118ab39d4
commit 2fdd0c9352
2 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,7 @@ class TimerAdaptor extends AItem {
this.state = 'ON';
mqtt.send(this.actionStateTopic, this.state, true);
this.timer = setTimeout(() => {
logger.info(`timer ${this.itemId} elapsed`);
this.state = 'OFF';
mqtt.send(this.actionStateTopic, this.state, true);
}, (this.delay * 1000));