refactoring
This commit is contained in:
@ -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));
|
||||
|
@ -11,6 +11,10 @@ let TimerAdaptor = require('./TimerAdaptor');
|
||||
let Forwarder = require('./Forwarder');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let aquariumLight = new M433SwitchItem('1st', 'Anna', 'AquariumLight', '14665044 24 1', '14665041 24 1');
|
||||
aquariumLight.start();
|
||||
|
||||
|
Reference in New Issue
Block a user