1- import type { TemplateResult } from 'lit'
2- import { css , html , LitElement } from 'lit'
3- import { customElement , property } from 'lit/decorators.js'
41import { actionHandler } from '@/action-handler-directive'
2+ import { Actions } from '@/types'
53import {
64 type ActionHandlerEvent ,
75 handleAction ,
86 hasAction ,
97 type HomeAssistant ,
108} from 'custom-card-helpers'
11- import { Actions } from '@/types'
9+ import type { TemplateResult } from 'lit'
10+ import { css , html , LitElement } from 'lit'
11+ import { customElement , property } from 'lit/decorators.js'
1212
1313type Status = null | number
1414
@@ -74,6 +74,7 @@ export class EntitiesTypeStatus extends LitElement {
7474 }
7575
7676 protected render ( ) : TemplateResult {
77+ const id = `entities-type-status-${ this . name . replace ( / \s + / g, '-' ) . toLowerCase ( ) } `
7778 const title = html `<h3 class= "entities-type-status__header" >
7879 ${ this . name } (${ this . activeCount ( ) } )
7980 </ h3>
@@ -86,8 +87,8 @@ export class EntitiesTypeStatus extends LitElement {
8687 } ) }
8788 </ ha- lis t> `
8889
89- return html `<ha - to oltip . content = " ${ title } " >
90- <div
90+ return html ` <div
91+ id = " ${ id } "
9192 class = "entities-type-status ${ this . activeEntities . length > 0
9293 ? 'entities-type-status--active'
9394 : '' } ${ this . hasAction ? 'entities-type-status--has-action' : '' } "
@@ -104,8 +105,9 @@ export class EntitiesTypeStatus extends LitElement {
104105 . size } px; --icon-size: ${ this . size / 1.7 } px"
105106 >
106107 <ha- icon icon= "${ this . icon } " > </ ha- icon>
107- </ div> </ div
108- > </ ha- to oltip> `
108+ </ div>
109+ </ div>
110+ <ha- to oltip for = "${ id } " > ${ title } </ ha- to oltip> `
109111 }
110112
111113 static styles = css `
0 commit comments