mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-20 02:21:20 +00:00
Fix race condition when Zigbee starts. #2591
This commit is contained in:
+2
-4
@@ -89,9 +89,10 @@ class Controller {
|
||||
|
||||
// Start zigbee
|
||||
try {
|
||||
await this.zigbee.start();
|
||||
this.callExtensionMethod('onZigbeeStarted', []);
|
||||
this.zigbee.on('event', this.onZigbeeEvent.bind(this));
|
||||
this.zigbee.on('adapterDisconnected', this.onZigbeeAdapterDisconnected);
|
||||
await this.zigbee.start();
|
||||
} catch (error) {
|
||||
logger.error('Failed to start zigbee');
|
||||
logger.error('Exiting...');
|
||||
@@ -123,9 +124,6 @@ class Controller {
|
||||
|
||||
this.zigbee.permitJoin(settings.get().permit_join);
|
||||
|
||||
// Call extensions
|
||||
this.callExtensionMethod('onZigbeeStarted', []);
|
||||
|
||||
// MQTT
|
||||
this.mqtt.on('message', this.onMQTTMessage.bind(this));
|
||||
await this.mqtt.connect();
|
||||
|
||||
Reference in New Issue
Block a user