Conversation
On first MQTT connect (auto-discovery not yet sent), publish retained "offline" to the update availability topic so HA shows "Unavailable" instead of the stale "Update available" from the previous session's retained state. The OTA check will publish "online" once it confirms the current firmware state. Also adds "online" to the onAvailable callback, which previously never set the availability topic, leaving the entity stuck "Unavailable" after the initial connect fix when an update is found. Closes #685 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
"offline"to the update availability topic so HA shows "Unavailable" instead of carrying over the stale "Update available" state from the previous session's retained message."online"to theonAvailablecallback, which previously never published to the availability topic. Without this, after the fix above, an update being found would leave the entity stuck at "Unavailable".Closes #685
Test plan
🤖 Generated with Claude Code