diff --git a/src/state/quick-bar-mixin.ts b/src/state/quick-bar-mixin.ts index 1aa198ac8e..cfefcb388c 100644 --- a/src/state/quick-bar-mixin.ts +++ b/src/state/quick-bar-mixin.ts @@ -18,7 +18,14 @@ export default >(superClass: T) => protected firstUpdated(changedProps: PropertyValues) { super.firstUpdated(changedProps); + this._registerShortcut(); + } + + private _registerShortcut() { document.addEventListener("keydown", (e: KeyboardEvent) => { + if (!this.hass?.user?.is_admin) { + return; + } if (this.isOSCtrlKey(e) && e.code === "KeyP") { e.preventDefault(); const eventParams: QuickBarParams = {};