Closed greendog99 closed 2 years ago
Yes, I already noticed that. Will be fixed in the next version. Thanks!
I modified my version in the interim, and came across another edge case: the Dark Sky weather integration returns null
when precipitation is 0 (instead of returning a float). That was causing the graph to not show up for me (after my changes). I had to add a check for null
and instead push a 0
into the array :-(
Fixed in v1.0.2. Could you check?
Tested OK with both 0
and null
values. Looks good to me!
Noticed that precipitation always appears on the first day of the forecast, even if rain isn't expected until later in the week. Here's the cause:
https://github.com/Yevgenium/weather-chart-card/blob/0c16ee74a90c8b0902d4a989d883f9d2207331c7/src/main.js#L145-L153
if (d.temperature)
resolves tofalse
for zero values (e.g. 0 degrees, 0 precipitation), causing these days to be skipped in the chart data. Need to use something likeif (typeof d.temperature !== 'undefined')
.Also, it may be best to insert a dummy value in these cases, so that if
d.datetime
andd.temperature
are defined, butd.templow
is not defined, the various arrays all keep the same length. Without doing that, the array that's missing a value will have all of its remaining data offset by one day.