Skip to content

Fix undefined status that stays forever in home assistant after autoreconnect happens#40

Merged
nmaupu merged 2 commits intonmaupu:masterfrom
Samt43:fix_mqtt_reconnect_home_assistant
Feb 7, 2026
Merged

Fix undefined status that stays forever in home assistant after autoreconnect happens#40
nmaupu merged 2 commits intonmaupu:masterfrom
Samt43:fix_mqtt_reconnect_home_assistant

Conversation

@Samt43
Copy link
Copy Markdown
Contributor

@Samt43 Samt43 commented Feb 7, 2026

Retablishes the connexion to homeassistant by republishing autodiscovery data

…connect retablishes the connexion by republishing autodiscovery data
Comment thread src/main.cpp Outdated
LOG.handle(); // telnetspy handling
ArduinoOTA.handle();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra spaces here

Comment thread src/main.cpp Outdated
}
}
}
else
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Else should be on the same line as the } like everywhere else in the code

@nmaupu
Copy link
Copy Markdown
Owner

nmaupu commented Feb 7, 2026

Hi ! What is the need for that?

@Samt43
Copy link
Copy Markdown
Contributor Author

Samt43 commented Feb 7, 2026

Hi @nmaupu !
This solves the bug i was encuntering :
On reboot of my homeassistant server hotspot, my 8266 running yokis-hack could get an IP adress using dhcp but my light entities in HA were staying unavailaible forever.

It seems that republishing autodiscovery data when reconnecting to mqtt server in the context of an autoreconnect was necessary to fix this.

@nmaupu
Copy link
Copy Markdown
Owner

nmaupu commented Feb 7, 2026

Your HA does have a fixed ip ?
I guess that's not a big deal to rediscover anyway, just curious :)

@nmaupu nmaupu merged commit 676b7ff into nmaupu:master Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants