refactoring
This commit is contained in:
@ -25,6 +25,7 @@ class TimerAdaptor extends AItem {
|
|||||||
this.state = 'ON';
|
this.state = 'ON';
|
||||||
mqtt.send(this.actionStateTopic, this.state, true);
|
mqtt.send(this.actionStateTopic, this.state, true);
|
||||||
this.timer = setTimeout(() => {
|
this.timer = setTimeout(() => {
|
||||||
|
logger.info(`timer ${this.itemId} elapsed`);
|
||||||
this.state = 'OFF';
|
this.state = 'OFF';
|
||||||
mqtt.send(this.actionStateTopic, this.state, true);
|
mqtt.send(this.actionStateTopic, this.state, true);
|
||||||
}, (this.delay * 1000));
|
}, (this.delay * 1000));
|
||||||
|
@ -11,6 +11,10 @@ let TimerAdaptor = require('./TimerAdaptor');
|
|||||||
let Forwarder = require('./Forwarder');
|
let Forwarder = require('./Forwarder');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let aquariumLight = new M433SwitchItem('1st', 'Anna', 'AquariumLight', '14665044 24 1', '14665041 24 1');
|
let aquariumLight = new M433SwitchItem('1st', 'Anna', 'AquariumLight', '14665044 24 1', '14665041 24 1');
|
||||||
aquariumLight.start();
|
aquariumLight.start();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user