Fix Apollo Firmware Version sensor showing unknown - #88
Conversation
The sensor was showing "unknown" because component.update silently fails when the component's is_ready() check returns false. Replaced with text_sensor.template.publish which calls publish_state() directly. Also removed update_interval: never so the lambda fires every 60s as a periodic fallback.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
WalkthroughRemoved component.update calls and the sensor lambda for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Per ESPHome dev feedback: the version is a compile-time constant, so publish it once on_boot rather than using a lambda with periodic updates. Removed publish from on_client_connected and reportAllValues script.
|
confirmed working! |
Version: 26.3.2.1
Adds:
Fixes:
component.updatewithtext_sensor.template.publishfor the version sensor in bothon_client_connectedandreportAllValuesscriptupdate_interval: neverso the lambda also fires periodically (every 60s) as a fallbackThe root cause is that ESPHome's
component.updateaction silently skips execution when the component'sis_ready()check fails (seeUpdateComponentAction::play()inesphome/core/base_automation.h). Thetext_sensor.template.publishaction callspublish_state()directly without this guard.Breaks:
Checks:
Summary by CodeRabbit