From 1dc8228e8dd5cb12de85b9bf7a6551aaa58a2d53 Mon Sep 17 00:00:00 2001 From: Arjan <44190435+vingerha@users.noreply.github.com> Date: Fri, 12 May 2023 22:40:21 +0200 Subject: [PATCH] Add wind forecast icons and switch (#109) --- dist/icons/arrow-north-static.svg | 2 ++ dist/icons/no-wind-bearing-static.svg | 1 + dist/meteofrance-weather-card-editor.js | 8 ++++++++ dist/meteofrance-weather-card.js | 14 ++++++++++++++ 4 files changed, 25 insertions(+) create mode 100644 dist/icons/arrow-north-static.svg create mode 100644 dist/icons/no-wind-bearing-static.svg diff --git a/dist/icons/arrow-north-static.svg b/dist/icons/arrow-north-static.svg new file mode 100644 index 0000000..db32a62 --- /dev/null +++ b/dist/icons/arrow-north-static.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/dist/icons/no-wind-bearing-static.svg b/dist/icons/no-wind-bearing-static.svg new file mode 100644 index 0000000..c32fbbf --- /dev/null +++ b/dist/icons/no-wind-bearing-static.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/dist/meteofrance-weather-card-editor.js b/dist/meteofrance-weather-card-editor.js index cdd78a5..950da2d 100644 --- a/dist/meteofrance-weather-card-editor.js +++ b/dist/meteofrance-weather-card-editor.js @@ -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 || ""; @@ -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" + )} ` : ""} + ${this._config.wind_forecast_icons && daily.wind_bearing !== undefined && daily.wind_bearing !== null + ? html` +
  • +
  • + ` + : ""} + ${this._config.wind_forecast_icons && daily.wind_bearing !== undefined && daily.wind_bearing == null + ? html` +
  • +
  • + ` + : ""} `; }