From 7817ebe9830215402fd78fd6b898b0ae06b3726a Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:23:37 -0800 Subject: [PATCH] Home strategy: don't link non-admin to config pages (#28512) --- .../home/home-area-view-strategy.ts | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/panels/lovelace/strategies/home/home-area-view-strategy.ts b/src/panels/lovelace/strategies/home/home-area-view-strategy.ts index fdc61f029c..940abaec9e 100644 --- a/src/panels/lovelace/strategies/home/home-area-view-strategy.ts +++ b/src/panels/lovelace/strategies/home/home-area-view-strategy.ts @@ -41,7 +41,9 @@ const computeHeadingCard = ( action: "navigate", navigation_path, } - : undefined, + : { + action: "none", + }, }) satisfies HeadingCardConfig; @customElement("home-area-view-strategy") @@ -182,7 +184,7 @@ export class HomeAreaViewStrategy extends ReactiveElement { computeHeadingCard( hass.localize("ui.panel.lovelace.strategy.home.scenes"), "mdi:palette", - "/config/scene/dashboard" + hass.user?.is_admin ? "/config/scene/dashboard" : undefined ), ...scenes.map(computeTileCard), ], @@ -285,12 +287,13 @@ export class HomeAreaViewStrategy extends ReactiveElement { { type: "heading", heading: heading, - tap_action: device - ? { - action: "navigate", - navigation_path: `/config/devices/device/${device.id}`, - } - : undefined, + tap_action: + hass.user?.is_admin && device + ? { + action: "navigate", + navigation_path: `/config/devices/device/${device.id}`, + } + : { action: "none" }, badges: [ ...batteryEntities.slice(0, 1).map((e) => ({ entity: e, @@ -334,7 +337,7 @@ export class HomeAreaViewStrategy extends ReactiveElement { computeHeadingCard( hass.localize("ui.panel.lovelace.strategy.home.automations"), "mdi:robot", - "/config/automation/dashboard" + hass.user?.is_admin ? "/config/automation/dashboard" : undefined ), ...automations.map(computeTileCard), ],