Closed scinos closed 1 month ago
@decompil3d I think I need some help with checking the config option icon_fill
. I see there are config tests in two places:
HourlyWeatherCard
, method setConfig
(https://github.com/decompil3d/lovelace-hourly-weather/blob/main/src/hourly-weather.ts#L192)HourlyWeatherCard
, method renderCore
(https://github.com/decompil3d/lovelace-hourly-weather/blob/main/src/hourly-weather.ts#L324)Why do we need two? Which one should I use to test the validity of icon_fill
option?
@decompil3d I think I need some help with checking the config option
icon_fill
. I see there are config tests in two places:
Class
HourlyWeatherCard
, methodsetConfig
(https://github.com/decompil3d/lovelace-hourly-weather/blob/main/src/hourly-weather.ts#L192)Class
HourlyWeatherCard
, methodrenderCore
(https://github.com/decompil3d/lovelace-hourly-weather/blob/main/src/hourly-weather.ts#L324)Why do we need two? Which one should I use to test the validity of
icon_fill
option?
I think checking validity in renderCore
would be most consistent with the existing code. Thanks for checking.
@decompil3d added tests, this PR is ready for review now
(Comes from #669)
What problem does this PR solve?
Adds the option to add more than one icon per forecast span. This should improve readability, specially for wallboards.
Proposed solution
Adds a new config
icon_fill
with three possible values:single
This is the default option and keeps current functionallity: it shows one single icon per span, centered.full
Show one icon per forecast segment. For example, it will display 12 sun icons if the next 12h is sunny.<n>
(an integer). Likefull
, but instead of displaying an icon per forecast segment, it will displaye an icon every nth segment. (In other words,full
and1
do the same). At the very least it will display one icon per span.This is how it looks like:
Alternatively, we can have this as a boolean (
icon_fill:false
current behaviour,icon_fill:true
fill all segments with icons), and introduce a second optionicon_spacing
(similar tolabel_spacing
) to be able to space out the icons