Skip to content

Commit

Permalink
Add wind forecast icons and switch (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
vingerha committed May 12, 2023
1 parent c24eb67 commit 1dc8228
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/icons/arrow-north-static.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/icons/no-wind-bearing-static.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions dist/meteofrance-weather-card-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export class MeteofranceWeatherCardEditor extends LitElement {
return this._config.animated_icons !== false;
}

get _wind_forecast_icons() {
return this._config.wind_forecast_icons !== false;
}
// Config value
get _alertEntity() {
return this._config.alertEntity || "";
Expand Down Expand Up @@ -178,6 +181,11 @@ export class MeteofranceWeatherCardEditor extends LitElement {
this._animated_icons,
"animated_icons"
)}
${this.renderSwitchOption(
"Show wind icons",
this._wind_forecast_icons,
"wind_forecast_icons"
)}
</ul>
<!-- -->
<paper-input
Expand Down
14 changes: 14 additions & 0 deletions dist/meteofrance-weather-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,20 @@ class MeteofranceWeatherCard extends LitElement {
</li>
`
: ""}
${this._config.wind_forecast_icons && daily.wind_bearing !== undefined && daily.wind_bearing !== null
? html`
<li class="icon"
style="background: none, url('/local/community/lovelace-meteofrance-weather-card/icons/arrow-north-static.svg'); background-size: contain; transform: rotate(${daily.wind_bearing + 180}deg) scale(0.5)">
</li>
`
: ""}
${this._config.wind_forecast_icons && daily.wind_bearing !== undefined && daily.wind_bearing == null
? html`
<li class="icon"
style="background: none, url('/local/community/lovelace-meteofrance-weather-card/icons/no-wind-bearing-static.svg'); background-size: contain; transform: scale(0.5)">
</li>
`
: ""}
</ul>
</li>`;
}
Expand Down

0 comments on commit 1dc8228

Please sign in to comment.