import { LitElement, html, css } from "lit";
import { property, state } from "lit/decorators.js";
import { loadDeveloperToolsTemplate } from "../helpers";
loadDeveloperToolsTemplate();
class BrowserModFrontendSettingsCard extends LitElement {
@property() hass;
@state() _selectedTab = 0;
firstUpdated() {
window.browser_mod.addEventListener("browser-mod-config-update", () =>
this.requestUpdate()
);
window.browser_mod.addEventListener("browser-mod-favicon-update", () =>
this.requestUpdate()
);
}
_handleSwitchTab(ev: CustomEvent) {
this._selectedTab = parseInt(ev.detail.index, 10);
}
render() {
const level = ["browser", "user", "global"][this._selectedTab];
return html`
Please note: The settings in this section severely change the way the Home
Assistant frontend works and looks. It is very easy to forget that
you made a setting here when you switch devices or user.
Do not report any issues to Home Assistant before clearing
EVERY setting here and thouroghly clearing all your browser
caches. Failure to do so means you risk wasting a lot of peoples
time, and you will be severly and rightfully ridiculed.
Global settings are applied for all users and browsers.
User settings are applied to the current user and overrides any Global settings.
Browser settings are applied for the current browser and overrides any User or Global settings.
Overridden by browser setting`;
if (level === "global" && user[key] !== undefined)
return html`
Overridden by user setting`;
};
return html`