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
This commit is contained in:
ildar170975 2025-03-24 18:25:28 +03:00 committed by GitHub
parent 60010c82bd
commit 586a137037
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -404,6 +404,10 @@ export class HaConfigDevicePage extends LitElement {
this._renderIntegrationInfo(device, integrations, deviceInfo); 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") const automationCard = isComponentLoaded(this.hass, "automation")
? html` ? html`
<ha-card outlined> <ha-card outlined>
@ -484,6 +488,7 @@ export class HaConfigDevicePage extends LitElement {
}` }`
), ),
})} })}
${add_prompt}
</div> </div>
`} `}
</ha-card> </ha-card>
@ -577,6 +582,7 @@ export class HaConfigDevicePage extends LitElement {
), ),
} }
)} )}
${add_prompt}
</div> </div>
`} `}
</ha-card> </ha-card>
@ -654,6 +660,7 @@ export class HaConfigDevicePage extends LitElement {
}` }`
), ),
})} })}
${add_prompt}
</div> </div>
`} `}
</ha-card> </ha-card>
@ -1422,7 +1429,10 @@ export class HaConfigDevicePage extends LitElement {
<span slot="header" <span slot="header"
>${this.hass.localize( >${this.hass.localize(
"ui.panel.config.devices.confirm_rename_entity_wont_rename", "ui.panel.config.devices.confirm_rename_entity_wont_rename",
{ deviceSlug: oldDeviceSlug, count: dialogNoRenames.length } {
deviceSlug: oldDeviceSlug,
count: dialogNoRenames.length,
}
)}</span )}</span
> >
${dialogNoRenames} ${dialogNoRenames}

View File

@ -4767,7 +4767,9 @@
} }
}, },
"devices": { "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", "add_device": "Add device",
"caption": "Devices", "caption": "Devices",
"description": "Manage configured devices", "description": "Manage configured devices",