Fix a bunch of translation strings (#5597)

* Fix a bunch of translation strings

* Fallback on default if no device class translations
This commit is contained in:
Paulus Schoutsen
2020-04-23 04:07:40 -07:00
committed by GitHub
parent 13a8bf6993
commit fc20fd32f1
15 changed files with 66 additions and 39 deletions

View File

@@ -20,6 +20,7 @@ import { HomeAssistant, WeatherEntity } from "../../../types";
import { EntitiesCardEntityConfig } from "../cards/types";
import { hasConfigOrEntityChanged } from "../common/has-changed";
import { LovelaceRow } from "./types";
import { computeStateDisplay } from "../../../common/entity/compute_state_display";
@customElement("hui-weather-entity-row")
class HuiWeatherEntityRow extends LitElement implements LovelaceRow {
@@ -69,8 +70,11 @@ class HuiWeatherEntityRow extends LitElement implements LovelaceRow {
<div class="attributes">
<div>
${UNAVAILABLE_STATES.includes(stateObj.state)
? this.hass.localize(`state.default.${stateObj.state}`) ||
stateObj.state
? computeStateDisplay(
this.hass.localize,
stateObj,
this.hass.language
)
: html`
${stateObj.attributes.temperature}
${getWeatherUnit(this.hass, "temperature")}