Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/platinum-weather-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`<div class="slot-text"></div>BFT: ${this.currentBeaufort} -&nbsp;</div>` : "";
const bearing = this._config.entity_wind_bearing ? html`<div class="slot-text">${this.currentWindBearing}&nbsp;</div>` : "";
const units = html`<div class="slot-text unit">${this.getUOM('length')}/h</div>`;
const units = html`<div class="slot-text unit">${this.currentWindSpeedUnit}</div>`;
const speed = this._config.entity_wind_speed ? html`<div class="slot-text">${this.currentWindSpeed}</div>${units}&nbsp;` : "";
const gust = this._config.entity_wind_gust ? html`<div class="slot-text">(Gust ${this.currentWindGust}</div>${units})` : "";
return html`
Expand Down Expand Up @@ -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]
Expand Down