mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[linky] Filter on dates when building the report requested from console (#17824)
Related to #17070 Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
parent
0d58d7ec62
commit
15c1d2eaf7
@ -326,6 +326,11 @@ public class LinkyHandler extends BaseThingHandler {
|
||||
: (days.datas.size() <= days.periodes.size() ? days.datas.size() : days.periodes.size());
|
||||
for (int i = 0; i < size; i++) {
|
||||
double consumption = days.datas.get(i);
|
||||
LocalDate day = days.periodes.get(i).dateDebut.toLocalDate();
|
||||
// Filter data in case it contains data from dates outside the requested period
|
||||
if (day.isBefore(startDay) || day.isAfter(endDay)) {
|
||||
continue;
|
||||
}
|
||||
String line = days.periodes.get(i).dateDebut.format(DateTimeFormatter.ISO_LOCAL_DATE) + separator;
|
||||
if (consumption >= 0) {
|
||||
line += String.valueOf(consumption);
|
||||
|
Loading…
Reference in New Issue
Block a user