Skip to content

fix: clear OTA update availability on initial MQTT connect after reboot#688

Merged
BrentIO merged 1 commit into
mainfrom
fix/685
Jun 21, 2026
Merged

fix: clear OTA update availability on initial MQTT connect after reboot#688
BrentIO merged 1 commit into
mainfrom
fix/685

Conversation

@BrentIO

@BrentIO BrentIO commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • On the first MQTT connect after boot (auto-discovery not yet sent), publishes retained "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.
  • Adds "online" to the onAvailable callback, 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

  • Install firmware with a known newer version available. Confirm HA shows "Update available" before reboot.
  • After reboot and MQTT reconnect, confirm HA shows "Unavailable" for the firmware entity while the 60-second OTA check delay elapses.
  • After the OTA check runs with an update available, confirm HA transitions to "Update available."
  • After the OTA check runs with no update available, confirm HA shows "Up to date."

🤖 Generated with Claude Code

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>
@BrentIO BrentIO merged commit 9140b1b into main Jun 21, 2026
2 checks passed
@BrentIO BrentIO deleted the fix/685 branch June 21, 2026 21:09
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.

fix: clear OTA update availability on initial MQTT connect after reboot

1 participant