Skip to content

Commit

Permalink
Fix rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mlamberts78 committed Oct 2, 2024
1 parent dcb4ac3 commit fd37b15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/weather-chart-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -18785,9 +18785,11 @@ renderMain({ config, sun, weather, temperature, feels_like, description } = this
roundedFeelsLike = Math.round(roundedFeelsLike * 10) / 10;
}

const iconSize = config.icons_size ? `${config.icons_size}px` : '25px'; // Default to 25px if not set

const iconHtml = config.animated_icons || config.icons
? x`<img src="${this.getWeatherIcon(weather.state, sun.state)}" alt="">`
: x`<ha-icon icon="${this.getWeatherIcon(weather.state, sun.state)}"></ha-icon>`;
? x`<img src="${this.getWeatherIcon(weather.state, sun.state)}" alt="weather icon" style="width: ${iconSize}; height: ${iconSize};">`
: x`<ha-icon icon="${this.getWeatherIcon(weather.state, sun.state)}" style="--mdc-icon-size: ${iconSize};"></ha-icon>`;

const updateClock = () => {
const currentDate = new Date();
Expand Down
6 changes: 4 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1002,9 +1002,11 @@ renderMain({ config, sun, weather, temperature, feels_like, description } = this
roundedFeelsLike = Math.round(roundedFeelsLike * 10) / 10;
}

const iconSize = config.icons_size ? `${config.icons_size}px` : '25px'; // Default to 25px if not set

const iconHtml = config.animated_icons || config.icons
? html`<img src="${this.getWeatherIcon(weather.state, sun.state)}" alt="">`
: html`<ha-icon icon="${this.getWeatherIcon(weather.state, sun.state)}"></ha-icon>`;
? html`<img src="${this.getWeatherIcon(weather.state, sun.state)}" alt="weather icon" style="width: ${iconSize}; height: ${iconSize};">`
: html`<ha-icon icon="${this.getWeatherIcon(weather.state, sun.state)}" style="--mdc-icon-size: ${iconSize};"></ha-icon>`;

const updateClock = () => {
const currentDate = new Date();
Expand Down

0 comments on commit fd37b15

Please sign in to comment.