mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
parent
9111f58e52
commit
c1748138a8
@ -586,7 +586,14 @@ class HaConfigAreaPage extends SubscribeMixin(LitElement) {
|
||||
}
|
||||
|
||||
private _renderScript(name: string, entityState: ScriptEntity) {
|
||||
return html`<a href=${`/config/script/edit/${entityState.entity_id}`}>
|
||||
const entry = this._entities.find(
|
||||
(e) => e.entity_id === entityState.entity_id
|
||||
);
|
||||
let url = `/config/script/show/${entityState.entity_id}`;
|
||||
if (entry) {
|
||||
url = `/config/script/edit/${entry.unique_id}`;
|
||||
}
|
||||
return html`<a href=${url}>
|
||||
<paper-item>
|
||||
<paper-item-body> ${name} </paper-item-body>
|
||||
<ha-icon-next></ha-icon-next>
|
||||
|
@ -567,11 +567,16 @@ export class HaConfigDevicePage extends LitElement {
|
||||
<div class="items">
|
||||
${this._related.script.map((script) => {
|
||||
const entityState = this.hass.states[script];
|
||||
const entry = this.entities.find(
|
||||
(e) => e.entity_id === script
|
||||
);
|
||||
let url = `/config/script/show/${entityState.entity_id}`;
|
||||
if (entry) {
|
||||
url = `/config/script/edit/${entry.unique_id}`;
|
||||
}
|
||||
return entityState
|
||||
? html`
|
||||
<a
|
||||
href=${`/config/script/edit/${entityState.entity_id}`}
|
||||
>
|
||||
<a href=${url}>
|
||||
<paper-item .script=${script}>
|
||||
<paper-item-body>
|
||||
${computeStateName(entityState)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user