pkissling / clock-weather-card

A Home Assistant Card indicating today's date/time, along with an iOS inspired weather forecast for the next days with animated icons
Other
397 stars 78 forks source link

Allow hiding duplicate temperature value in hourly forecast view #363

Open tommyalatalo opened 5 months ago

tommyalatalo commented 5 months ago

Context

When using the hourly forecast view temperature values are shown on both the left and right side of the bar graphic, this is rather redundant, and it would be nice to have an option to hide the rightmost value so that all the data (time, weather and temperature) are only shown to the left of the bars.

image

Suggested solution

Add an option to hide the temperature values on the right side of the bars as pointed out below. Or, personally I would argue that removing these duplicate temperature values should be the default, as it's just clutter when using the hourly forecast, but I'm not sure if there are other perspectives to this.

Alternatives

I'm not sure if it's possible to use card-mod to modify this, as both of the temperature elements in the DOM are of the same type; forecast-text. If this can be done I'm open to using that, but I'm not sure how to target only the right one.

itpeters commented 3 months ago

Came here looking to see if this request had already been raised. @tommyalatalo here is how to achieve it with card-mod in the meantime!

card_mod:
  style: |
    clock-weather-card-forecast-row forecast-text:last-of-type {
      display: none;
    }
    clock-weather-card-forecast-row forecast-temperature-bar {
      grid-column: 4/6;
    }
rymiller11 commented 2 months ago

I can see why having the values on the left and right have some value. In my case, the current temp from a sensor is higher than the value during the current hour, and therefore there is a bar instead of a point on the line. But, that's only applicable to the first hour (or current hour).

image