mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Fix device config tooltips (#24780)
* Device config tooltips * Update src/panels/config/devices/ha-config-device-page.ts Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com> --------- Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
This commit is contained in:
parent
9cfcd21a93
commit
fb11c21518
@ -448,30 +448,18 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
${this._related.automation.map((automation) => {
|
${this._related.automation.map((automation) => {
|
||||||
const entityState = this.hass.states[automation];
|
const entityState = this.hass.states[automation];
|
||||||
return entityState
|
return entityState
|
||||||
? html`<ha-tooltip
|
? html`<a
|
||||||
placement="left"
|
|
||||||
.disabled=${!!entityState.attributes.id}
|
|
||||||
.content=${this.hass.localize(
|
|
||||||
"ui.panel.config.devices.cant_edit"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
href=${ifDefined(
|
href=${ifDefined(
|
||||||
entityState.attributes.id
|
entityState.attributes.id
|
||||||
? `/config/automation/edit/${encodeURIComponent(entityState.attributes.id)}`
|
? `/config/automation/edit/${encodeURIComponent(entityState.attributes.id)}`
|
||||||
: undefined
|
: `/config/automation/show/${entityState.entity_id}`
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<ha-list-item
|
<ha-list-item hasMeta .automation=${entityState}>
|
||||||
hasMeta
|
|
||||||
.automation=${entityState}
|
|
||||||
.disabled=${!entityState.attributes.id}
|
|
||||||
>
|
|
||||||
${computeStateName(entityState)}
|
${computeStateName(entityState)}
|
||||||
<ha-icon-next slot="meta"></ha-icon-next>
|
<ha-icon-next slot="meta"></ha-icon-next>
|
||||||
</ha-list-item>
|
</ha-list-item>
|
||||||
</a>
|
</a>`
|
||||||
</ha-tooltip>`
|
|
||||||
: nothing;
|
: nothing;
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
@ -536,34 +524,30 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
<div class="items">
|
<div class="items">
|
||||||
${this._related.scene.map((scene) => {
|
${this._related.scene.map((scene) => {
|
||||||
const entityState = this.hass.states[scene];
|
const entityState = this.hass.states[scene];
|
||||||
return entityState
|
return entityState && entityState.attributes.id
|
||||||
? html`
|
? html`
|
||||||
<ha-tooltip
|
|
||||||
placement="left"
|
|
||||||
.disabled=${!!entityState.attributes.id}
|
|
||||||
.content=${this.hass.localize(
|
|
||||||
"ui.panel.config.devices.cant_edit"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<a
|
<a
|
||||||
href=${ifDefined(
|
href=${`/config/scene/edit/${entityState.attributes.id}`}
|
||||||
entityState.attributes.id
|
|
||||||
? `/config/scene/edit/${entityState.attributes.id}`
|
|
||||||
: undefined
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<ha-list-item
|
|
||||||
hasMeta
|
|
||||||
.scene=${entityState}
|
|
||||||
.disabled=${!entityState.attributes.id}
|
|
||||||
>
|
>
|
||||||
|
<ha-list-item hasMeta .scene=${entityState}>
|
||||||
${computeStateName(entityState)}
|
${computeStateName(entityState)}
|
||||||
<ha-icon-next slot="meta"></ha-icon-next>
|
<ha-icon-next slot="meta"></ha-icon-next>
|
||||||
</ha-list-item>
|
</ha-list-item>
|
||||||
</a>
|
</a>
|
||||||
</ha-tooltip>
|
|
||||||
`
|
`
|
||||||
: nothing;
|
: html`
|
||||||
|
<ha-tooltip
|
||||||
|
placement="left"
|
||||||
|
.content=${this.hass.localize(
|
||||||
|
"ui.panel.config.devices.cant_edit"
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<ha-list-item hasMeta .scene=${entityState}>
|
||||||
|
${computeStateName(entityState)}
|
||||||
|
<ha-icon-next slot="meta"></ha-icon-next>
|
||||||
|
</ha-list-item>
|
||||||
|
</ha-tooltip>
|
||||||
|
`;
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user