mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-09-26 09:28:06 +00:00
18 lines
572 B
JavaScript
18 lines
572 B
JavaScript
export default class Example {
|
|
constructor(zigbee, mqtt, state, publishEntityState, eventBus) {
|
|
this.mqtt = mqtt;
|
|
this.mqtt.publish('example/extension', 'call from constructor');
|
|
this.counter = 0;
|
|
}
|
|
|
|
start() {
|
|
this.mqtt.publish('example/extension', 'call from start');
|
|
this.mqtt.publish('example/extension/counter', `start ${this.counter++}`);
|
|
}
|
|
|
|
stop() {
|
|
this.mqtt.publish('example/extension', 'call from stop');
|
|
this.mqtt.publish('example/extension/counter', `stop ${--this.counter}`);
|
|
}
|
|
}
|