Translate entity attribute names & attribute states (#15822)

This commit is contained in:
Franck Nijhof
2023-03-17 11:43:59 +01:00
committed by GitHub
parent dfd7acd713
commit 0232c11bc2
11 changed files with 188 additions and 131 deletions

View File

@@ -4,7 +4,7 @@ import { customElement, property, query } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event";
import { computeStateDisplay } from "../../common/entity/compute_state_display";
import { getStates } from "../../common/entity/get_states";
import { formatAttributeValue } from "../../data/entity_attributes";
import { computeAttributeValueDisplay } from "../../common/entity/compute_attribute_display";
import { PolymerChangedEvent } from "../../polymer-types";
import { HomeAssistant } from "../../types";
import "../ha-combo-box";
@@ -58,7 +58,14 @@ class HaEntityStatePicker extends LitElement {
this.hass.entities,
key
)
: formatAttributeValue(this.hass, key),
: computeAttributeValueDisplay(
this.hass.localize,
state,
this.hass.locale,
this.hass.entities,
this.attribute,
key
),
}))
: [];
}