Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hass.io: Support automated panel integration #3113

Merged
merged 3 commits into from
Apr 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions hassio/src/addon-view/hassio-addon-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) {
checked="[[addon.protected]]"
></paper-toggle-button>
</div>
<template is="dom-if" if="[[addon.ingress]]">
<div class="state">
<div>Show in Panel</div>
<paper-toggle-button
on-change="panelToggled"
checked="[[addon.ingress_panel]]"
></paper-toggle-button>
</div>
</template>
</template>
</div>
<div class="card-actions">
Expand Down Expand Up @@ -522,6 +531,11 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) {
this.set("addon.protected", !this.addon.protected);
}

panelToggled() {
const data = { ingress_panel: !this.addon.ingress_panel };
this.hass.callApi("POST", `hassio/addons/${this.addonSlug}/options`, data);
}

showMoreInfo(e) {
const id = e.target.getAttribute("id");
showHassioMarkdownDialog(this, {
Expand Down