Signed-off-by: Anders Alfredsson <andersb86@gmail.com>
or the number of hours/days from now) + the channel id, concatenated with a `#`.
Examples:
+
* Temperature for the current hour: `hour_0#t`
* Total precipitation 3 days from now: `day_3#ptotal`
*/
public static Optional<BigDecimal> total(TimeSeries timeSeries, int dayOffset, String parameter) {
List<Forecast> dayForecasts = timeSeries.getDay(dayOffset);
+ if (dayForecasts.size() == 1) {
+ return dayForecasts.get(0).getParameter(parameter);
+ }
List<BigDecimal> values = new ArrayList<>();
for (int i = 0; i < dayForecasts.size(); i++) {
Forecast current = dayForecasts.get(i);
} catch (RuntimeException e) {
logger.warn("Unexpected exception occurred, please report to the developers: {}: {}", e.getClass(),
e.getMessage());
+ logger.debug("Details: ", e);
}
}