From 586a137037a216c491a9b727ebe7c415acf1d8f3 Mon Sep 17 00:00:00 2001
From: ildar170975 <71872483+ildar170975@users.noreply.github.com>
Date: Mon, 24 Mar 2025 18:25:28 +0300
Subject: [PATCH] Device page: use different prompts for "device = enabled" &
"device = disabled" cases (#24739)
* prompts for enabled & disabled devices
* add different prompts for "device = enabled" & "device = disabled"
* prettier
* prettier
* prettier
* prettier
* prettier
* prettier
---
src/panels/config/devices/ha-config-device-page.ts | 12 +++++++++++-
src/translations/en.json | 4 +++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts
index 58e7273bca..6d11865f63 100644
--- a/src/panels/config/devices/ha-config-device-page.ts
+++ b/src/panels/config/devices/ha-config-device-page.ts
@@ -404,6 +404,10 @@ export class HaConfigDevicePage extends LitElement {
this._renderIntegrationInfo(device, integrations, deviceInfo);
+ const add_prompt = device.disabled_by
+ ? this.hass.localize("ui.panel.config.devices.add_prompt_disabled")
+ : this.hass.localize("ui.panel.config.devices.add_prompt_enabled");
+
const automationCard = isComponentLoaded(this.hass, "automation")
? html`
@@ -484,6 +488,7 @@ export class HaConfigDevicePage extends LitElement {
}`
),
})}
+ ${add_prompt}
`}
@@ -577,6 +582,7 @@ export class HaConfigDevicePage extends LitElement {
),
}
)}
+ ${add_prompt}
`}
@@ -654,6 +660,7 @@ export class HaConfigDevicePage extends LitElement {
}`
),
})}
+ ${add_prompt}
`}
@@ -1422,7 +1429,10 @@ export class HaConfigDevicePage extends LitElement {
${this.hass.localize(
"ui.panel.config.devices.confirm_rename_entity_wont_rename",
- { deviceSlug: oldDeviceSlug, count: dialogNoRenames.length }
+ {
+ deviceSlug: oldDeviceSlug,
+ count: dialogNoRenames.length,
+ }
)}
${dialogNoRenames}
diff --git a/src/translations/en.json b/src/translations/en.json
index 1896421fa2..4c804b98b9 100644
--- a/src/translations/en.json
+++ b/src/translations/en.json
@@ -4767,7 +4767,9 @@
}
},
"devices": {
- "add_prompt": "No {name} have been added using this {type} yet. You can add one by pressing the + button above.",
+ "add_prompt": "No {name} have been added using this {type} yet.",
+ "add_prompt_enabled": "You can add one by pressing the + button above.",
+ "add_prompt_disabled": "You can re-enable the device then add one by pressing the + button above.",
"add_device": "Add device",
"caption": "Devices",
"description": "Manage configured devices",