Don't show pointer for glance entity when there is no action (#17625)

This commit is contained in:
karwosts 2023-08-21 06:51:33 -07:00 committed by GitHub
parent eca3ec7f98
commit 92358b4859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,10 +206,12 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
margin-bottom: 12px;
width: var(--glance-column-width, 20%);
}
.entity.action {
cursor: pointer;
}
.entity:focus {
outline: none;
background: var(--divider-color);
@ -282,9 +284,15 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
const name = entityConf.name ?? computeStateName(stateObj);
const hasAnyAction =
!entityConf.tap_action ||
hasAction(entityConf.tap_action) ||
hasAction(entityConf.hold_action) ||
hasAction(entityConf.double_tap_action);
return html`
<div
class="entity"
class=${classMap({ entity: true, action: hasAnyAction })}
.config=${entityConf}
@action=${this._handleAction}
.actionHandler=${actionHandler({