Change frontend setting prioritization

This commit is contained in:
2022-07-24 13:24:17 +00:00
parent d5edd2452a
commit 02c8f91690
7 changed files with 26 additions and 22 deletions

View File

@@ -58,7 +58,7 @@ class BrowserModRegisteredBrowsersCard extends LitElement {
</div>
<div class="card-content">
<ha-settings-row>
<span slot="heading">Enable</span>
<span slot="heading">Register</span>
<span slot="description"
>Enable this browser as a Device in Home Assistant</span
>

View File

@@ -23,9 +23,9 @@ class BrowserModFrontendSettingsCard extends LitElement {
}
render() {
const level = ["browser", "user", "global"][this._selectedTab];
const level = ["user", "browser", "global"][this._selectedTab];
return html`
<ha-card header="Frontend settings" outlined>
<ha-card header="Frontend Settings" outlined>
<div class="card-content">
<ha-alert alert-type="warning">
<p>
@@ -49,10 +49,10 @@ class BrowserModFrontendSettingsCard extends LitElement {
.activeIndex=${this._selectedTab}
@MDCTabBar:activated=${this._handleSwitchTab}
>
<mwc-tab .label=${"Browser"}></mwc-tab>
<ha-icon .icon=${"mdi:chevron-double-right"}></ha-icon>
<mwc-tab .label=${"User (" + this.hass.user.name + ")"}></mwc-tab>
<ha-icon .icon=${"mdi:chevron-double-right"}></ha-icon>
<mwc-tab .label=${"Browser"}></mwc-tab>
<ha-icon .icon=${"mdi:chevron-double-right"}></ha-icon>
<mwc-tab .label=${"Global"}></mwc-tab>
</mwc-tab-bar>
@@ -64,9 +64,9 @@ class BrowserModFrontendSettingsCard extends LitElement {
_render_settings(level) {
const global = window.browser_mod.global_settings;
const user = window.browser_mod.user_settings;
const browser = window.browser_mod.browser_settings;
const current = { global, user, browser }[level];
const user = window.browser_mod.user_settings;
const current = { global, browser, user }[level];
const DESC_BOOLEAN = (val) =>
({ true: "Enabled", false: "Disabled", undefined: "Unset" }[String(val)]);

View File

@@ -145,8 +145,8 @@ export const ConnectionMixin = (SuperClass) => {
get settings() {
return {
...this.global_settings,
...this.user_settings,
...this.browser_settings,
...this.user_settings,
};
}

View File

@@ -48,11 +48,11 @@ export const AutoSettingsMixin = (SuperClass) => {
selectTree(
document.body,
"home-assistant$home-assistant-main$app-drawer-layout"
).then((el) => el.style.setProperty("--app-drawer-width", "0px"));
).then((el) => el?.style?.setProperty("--app-drawer-width", "0px"));
selectTree(
document.body,
"home-assistant$home-assistant-main$app-drawer-layout app-drawer"
).then((el) => el.remove());
).then((el) => el?.remove?.());
}
// Hide header

View File

@@ -42,7 +42,7 @@ import { BrowserIDMixin } from "./browserID";
x navigate
- lovelace-reload?
x window-reload
- screensaver
- screensaver ?
x sequence
x delay
x javascript eval
@@ -64,6 +64,8 @@ import { BrowserIDMixin } from "./browserID";
- Video player?
- Media_seek
- Screensavers
- IMPORTANT: FIX DEFAULT HIDING OF ENTITIES
- Check functionality with CAST - may need to add frontend part as a lovelace resource
*/
export class BrowserMod extends ServicesMixin(
PopupMixin(