Skip to content

Add missing bashio::addon.ingress_panel() function#185

Merged
frenck merged 3 commits intohassio-addons:mainfrom
lmagyar:pr-ingress-panel
Apr 10, 2026
Merged

Add missing bashio::addon.ingress_panel() function#185
frenck merged 3 commits intohassio-addons:mainfrom
lmagyar:pr-ingress-panel

Conversation

@lmagyar
Copy link
Copy Markdown
Contributor

@lmagyar lmagyar commented Jan 23, 2026

Proposed Changes

Tested, works.

Related Issues

Summary by CodeRabbit

  • New Features
    • Add-ons can now remotely read and update ingress panel settings, optionally targeting a specific add-on, with changes applied immediately for more flexible panel configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 23, 2026

Walkthrough

Added a new public function bashio::addon.ingress_panel() in lib/addons.sh that implements getter/setter behavior for an addon's ingress panel state. It accepts an optional slug (default self) and optional state; when state is provided it JSON-encodes and POSTs to /addons/${slug}/options, flushes the cache, and handles non-OK responses.

Changes

Cohort / File(s) Summary
New Addon Ingress Panel Helper
lib/addons.sh
Added public function bashio::addon.ingress_panel() to get or set an addon's ingress_panel state. Setter: JSON-encodes provided value, POSTs to /addons/${slug}/options, flushes cache, logs error on non-OK, returns NOK on failure. Getter: reads addons.${slug}.ingress_panel via existing helper. (+25/-0)

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant AddonsLib as "lib/addons.sh"
    participant Supervisor as "Supervisor API (/addons/*/options)"
    participant Cache as "Cache"
    participant Logger

    Caller->>AddonsLib: bashio::addon.ingress_panel(slug?, state?)
    alt state provided (setter)
        AddonsLib->>Supervisor: POST /addons/${slug}/options (JSON payload)
        Supervisor-->>AddonsLib: HTTP 200 OK / non-OK
        AddonsLib->>Cache: flush
        alt non-OK
            AddonsLib->>Logger: log error
            AddonsLib-->>Caller: return NOK
        else OK
            AddonsLib-->>Caller: return OK
        end
    else state omitted (getter)
        AddonsLib->>AddonsLib: read addons.${slug}.ingress_panel
        AddonsLib-->>Caller: return value
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nudged a panel, small and bright,
I wrap the state in JSON light,
I post, I flush, I tidy the way,
A little helper hops to stay,
Enjoy the door I made today 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add missing bashio::addon.ingress_panel() function' clearly and specifically describes the main change: adding a new function to the bashio library.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@lmagyar lmagyar changed the title Add missing bashio::addon.ingress_panel function Add missing bashio::addon.ingress_panel() function Jan 23, 2026
@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Feb 28, 2026
@lmagyar
Copy link
Copy Markdown
Contributor Author

lmagyar commented Feb 28, 2026

not stale

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Mar 1, 2026
@github-actions
Copy link
Copy Markdown

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale There has not been activity on this issue or PR for quite some time. label Mar 31, 2026
@lmagyar
Copy link
Copy Markdown
Contributor Author

lmagyar commented Mar 31, 2026

not stale

@github-actions github-actions bot removed the stale There has not been activity on this issue or PR for quite some time. label Apr 1, 2026
@frenck frenck added the new-feature New features or options. label Apr 7, 2026
@frenck frenck requested a review from Copilot April 7, 2026 13:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a missing Bashio helper to read or update an add-on’s ingress_panel option via the Supervisor API, aligning it with existing option-style helpers (e.g., auto_update, watchdog).

Changes:

  • Add bashio::addon.ingress_panel() to get the current ingress_panel state (defaults to false when absent).
  • Add ability to set ingress_panel for a target add-on (or self) by POSTing to /addons/<slug>/options and flushing cache.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @lmagyar 👍

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck frenck merged commit 174465b into hassio-addons:main Apr 10, 2026
8 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2026
@lmagyar lmagyar deleted the pr-ingress-panel branch April 13, 2026 09:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants