Closed afarago closed 6 months ago
Interesting, I wonder if this is a result of the recent change to use a web service call to get forecasts from HA. Perhaps we can hold off on showing errors if the web service call hasn't completed yet. If someone has time to look at this I can look at a PR. Otherwise, I'll get to this when I can.
I also got the same error come up on my little wall panel
So in the past days I was able to debug the problem, and get the root cause.
subscribeToForecastEvents
renderCore
const forecast = this.getForecast();
this.forecastEvent?.forecast
is equals null in private getForecast()
that returns the default daily granularity from the this.hass?.states[this.config.entity]?.attributes.forecast
(6 items with daily granularity))this._showError(this.localize('errors.too_many_segments_requested'))
)subscribeMessage
callback returns with the hourly distribution (24 entries in the array)I have an initial suggestion, please feel to review the PR and comment/modify.
Checklist:
Release with the issue: 5.3.0
Last working release (if known):
Browser and Operating System: Version 119.0.6045.160 (Official Build) (64-bit) Windows 11
Description of problem: Initial loading of the page shows an error, that disappears in <1 sec, still is quite disturbing.
This comes upw even with the simplest layout of the card.
Javascript errors shown in the web inspector (if applicable): none
Additional information: example config tested: