Add tooltips and aria-labels to climate modes (#10875)

This commit is contained in:
Philip Allgaier 2021-12-12 13:25:05 +01:00 committed by GitHub
parent 1f671198aa
commit 2606d55895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,7 @@ import {
svg, svg,
TemplateResult, TemplateResult,
} from "lit"; } from "lit";
import { customElement, property, state, query } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map"; import { classMap } from "lit/directives/class-map";
import { UNIT_F } from "../../../common/const"; import { UNIT_F } from "../../../common/const";
import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element"; import { applyThemesOnElement } from "../../../common/dom/apply_themes_on_element";
@ -427,6 +427,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
@click=${this._handleAction} @click=${this._handleAction}
tabindex="0" tabindex="0"
.path=${modeIcons[mode]} .path=${modeIcons[mode]}
.label=${this.hass!.localize(`component.climate.state._.${mode}`)}
> >
</ha-icon-button> </ha-icon-button>
`; `;