From cd344476034c9c219034ab5d049a89c3efd22219 Mon Sep 17 00:00:00 2001 From: Wendelin <12148533+wendevlin@users.noreply.github.com> Date: Wed, 3 Dec 2025 14:02:25 +0100 Subject: [PATCH] Hide disabled devices in automation target tree (#28307) --- .../ha-automation-add-from-target.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts b/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts index 9986f2f8ce..f7fb75a3b6 100644 --- a/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts +++ b/src/panels/config/automation/add-automation-element/ha-automation-add-from-target.ts @@ -911,6 +911,10 @@ export default class HaAutomationAddFromTarget extends LitElement { const services: Record = {}; unassignedDevices.forEach(({ id: deviceId, entry_type }) => { + const device = this.devices[deviceId]; + if (!device || device.disabled_by) { + return; + } const deviceEntry = { open: false, entities: @@ -1012,6 +1016,10 @@ export default class HaAutomationAddFromTarget extends LitElement { const devices: Record = {}; referenced_devices.forEach(({ id: deviceId }) => { + const device = this.devices[deviceId]; + if (!device || device.disabled_by) { + return; + } devices[deviceId] = { open: false, entities: