mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-02 18:11:36 +00:00
18 lines
576 B
JavaScript
18 lines
576 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}`);
|
|
}
|
|
}
|