Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Seime <[email protected]>
  • Loading branch information
seime committed Jan 25, 2022
1 parent 6c6c024 commit 277f3c1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ protected void updateChannel(ChannelUID channelUID, Appliance appliance, Data da
}
break;
case CHANNEL_WATERCONSUMPTION:
newState = sumWaterCosumption(dataPoint);
newState = sumWaterConsumption(dataPoint);
break;
case CHANNEL_WATERCONSUMPTION_SINCE_MIDNIGHT:
newState = sumWaterCosumptionSinceMidnight(dataPoint);
newState = sumWaterConsumptionSinceMidnight(dataPoint);
break;
default:
throw new IllegalArgumentException("Channel " + channelUID + " not supported.");
Expand All @@ -124,7 +124,7 @@ protected void updateChannel(ChannelUID channelUID, Appliance appliance, Data da
}
}

private QuantityType<Volume> sumWaterCosumptionSinceMidnight(Data dataPoint) {
private QuantityType<Volume> sumWaterConsumptionSinceMidnight(Data dataPoint) {
ZonedDateTime earliestWithdrawal = ZonedDateTime.now(ZoneId.systemDefault()).truncatedTo(ChronoUnit.DAYS);
ZonedDateTime latestWithdrawal = earliestWithdrawal.plus(1, ChronoUnit.DAYS);

Expand All @@ -135,7 +135,7 @@ private QuantityType<Volume> sumWaterCosumptionSinceMidnight(Data dataPoint) {
return new QuantityType<>(waterConsumption, Units.LITRE);
}

private QuantityType<Volume> sumWaterCosumption(Data dataPoint) {
private QuantityType<Volume> sumWaterConsumption(Data dataPoint) {
Double waterConsumption = dataPoint.getWithdrawals().stream()
.mapToDouble(withdrawal -> withdrawal.getWaterconsumption()).sum();
return new QuantityType(waterConsumption, Units.LITRE);
Expand Down

0 comments on commit 277f3c1

Please sign in to comment.