diff --git a/src/platinum-weather-card.ts b/src/platinum-weather-card.ts index ce8a1e4..9606e05 100644 --- a/src/platinum-weather-card.ts +++ b/src/platinum-weather-card.ts @@ -1400,7 +1400,7 @@ export class PlatinumWeatherCard extends LitElement { get slotWind(): TemplateResult { const beaufort = this._config.entity_wind_speed && this._config.option_show_beaufort ? html`
BFT: ${this.currentBeaufort} - ` : ""; const bearing = this._config.entity_wind_bearing ? html`
${this.currentWindBearing} 
` : ""; - const units = html`
${this.getUOM('length')}/h
`; + const units = html`
${this.currentWindSpeedUnit}
`; const speed = this._config.entity_wind_speed ? html`
${this.currentWindSpeed}
${units} ` : ""; const gust = this._config.entity_wind_gust ? html`
(Gust ${this.currentWindGust}
${units})` : ""; return html` @@ -1607,6 +1607,17 @@ export class PlatinumWeatherCard extends LitElement { : '---'; } + get currentWindSpeedUnit(): string { + const entity = this._config.entity_wind_speed; + return entity && this.hass.states[entity] + ? entity.match('^weather.') === null + ? this.getUOM('length')}+'/h' + : this.hass.states[entity].attributes.wind_speed_unit !== undefined + ? this.hass.states[t].attributes.wind_speed_unit + : this.getUOM('length')}+'/h' + : '---'; + } + get currentWindGust(): string { const entity = this._config.entity_wind_gust; return entity && this.hass.states[entity]