Better fix for #13382

This commit is contained in:
Koen Kanters
2022-08-11 20:23:19 +02:00
parent 619d5232db
commit 6314b86d9b
+2 -3
View File
@@ -98,10 +98,9 @@ export default class MQTT {
}, utils.seconds(10));
logger.info('Connected to MQTT server');
await this.publishStateOnline();
if (this.initialConnect) {
await this.publishStateOnline();
} else {
if (!this.initialConnect) {
this.republishRetainedTimer = setTimeout(() => {
// Republish retained messages in case MQTT broker does not persist them.
// https://github.com/Koenkk/zigbee2mqtt/issues/9629