Skip to content

feat: show one bundled FTW version when packaged as the Home Assistant add-on - #701

Draft
HuggeK wants to merge 1 commit into
srcfl:masterfrom
HuggeK:feat/ha-addon-bundle-version
Draft

feat: show one bundled FTW version when packaged as the Home Assistant add-on#701
HuggeK wants to merge 1 commit into
srcfl:masterfrom
HuggeK:feat/ha-addon-bundle-version

Conversation

@HuggeK

@HuggeK HuggeK commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What

When Core runs inside a single-image bundle that sets FTW_BUNDLE=home_assistant_addon (the Home Assistant add-on), Settings → System now shows one bundled FTW version row instead of the per-container Core/Optimizer breakdown, and the Optimizer Update/Rollback buttons are not rendered there. Native installs are unchanged.

  • go/internal/components/bundle.go: new Bundle type + BundleFromEnv() reading FTW_BUNDLE / FTW_BUNDLE_VERSION.
  • /api/components includes a bundle object when set; omitted for native installs.
  • web/settings/tabs/system.js: new pure bundleDisplay() helper picks the collapsed view; drivers row, optimizer fallback warning, and the component-action status line stay.

Why

In the Home Assistant add-on, Core and the Optimizer ship in one image whose updates and rollback belong to Supervisor (srcfl/home-assistant-addons, self-update disabled). A per-container version breakdown with update buttons misleads there: nothing updates independently, and the operator's real question is "which FTW version is this add-on running?"

Behaviour details and safety notes
  • The optimizer degraded/fallback warning is still shown in bundled mode — it is a health signal, not a version breakdown.
  • The Drivers row and Refresh stay: signed managed drivers remain independently updateable in the add-on.
  • Button wiring is unchanged; the existing if (btn) guards already tolerate the buttons being absent from the DOM.
  • bundle.version (the add-on version) is optional; the FTW version shown is Core's compiled-in version.
  • Unknown FTW_BUNDLE kinds keep the native view, so nothing changes until a packaging opts in.
Testing
  • go test ./internal/components/ ./internal/api/ — new tests: TestBundleFromEnv*, TestComponentsReportsBundlePackaging, TestComponentsOmitsBundleForNativeInstalls (pre-existing failures in internal/api on Windows — backup lifecycle + myUplink OAuth — fail identically on the untouched base).
  • node --test web/settings/tabs/system.test.mjs — 6/6 pass, including three new bundleDisplay cases.
  • node --test web/javascript-syntax.test.mjs — pass.
  • gofmt/go vet clean for the touched packages (two pre-existing gofmt offsides in api.go/api_components.go left as-is to keep the diff small).

Companion add-on change: HuggeK/home-assistant-addons sets FTW_BUNDLE / FTW_BUNDLE_VERSION in the add-on image; it is a no-op until an FTW release containing this PR is pinned there.

🤖 Generated with Claude Code

…t add-on

When FTW_BUNDLE=home_assistant_addon is set by the bundle image, /api/components reports the packaging and Settings -> System shows the single bundled FTW version instead of the per-container Core/Optimizer breakdown with update and rollback buttons that Supervisor-owned installs cannot use.

Co-authored-by: HuggeK <48095810+HuggeK@users.noreply.github.com>
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