Skip to content

Commit

Permalink
[conluz-83] Fixed some namings
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorKhan committed Oct 23, 2024
1 parent d65ec6b commit 2ca2425
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ List<ShellyInstantConsumption> getHourlyConsumptionsByRangeOfDatesAndSupply(@Not

List<ShellyConsumption> getAllConsumptions();

List<ShellyInstantConsumption> getShellyMqttPowerMessagesByRangeOfDates(OffsetDateTime periodBefore,
OffsetDateTime now);
List<ShellyInstantConsumption> getShellyMqttPowerMessagesByRangeOfDates(OffsetDateTime startDate,
OffsetDateTime endDate);
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ public List<ShellyConsumption> getAllConsumptions() {
}

@Override
public List<ShellyInstantConsumption> getShellyMqttPowerMessagesByRangeOfDates(OffsetDateTime periodBefore, OffsetDateTime now) {
String startDateAsString = dateConverter.convertToString(periodBefore);
String endDateAsString = dateConverter.convertToString(now);
public List<ShellyInstantConsumption> getShellyMqttPowerMessagesByRangeOfDates(OffsetDateTime startDate, OffsetDateTime endDate) {
String startDateAsString = dateConverter.convertToString(startDate);
String endDateAsString = dateConverter.convertToString(endDate);

try (InfluxDB connection = influxDbConnectionManager.getConnection()) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public ShellyMqttPowerMessagesToInstantConsumptionsProcessor(
this.persistShellyConsumptionRepository = persistShellyConsumptionRepository;
}

public void parse(OffsetDateTime periodBefore, OffsetDateTime now) {
public void process(OffsetDateTime startDate, OffsetDateTime endDate) {

List<ShellyInstantConsumption> instantConsumptions = getShellyConsumptionRepository.getShellyMqttPowerMessagesByRangeOfDates(
periodBefore, now);
startDate, endDate);

persistShellyConsumptionRepository.persistInstantConsumptions(instantConsumptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void run() {
OffsetDateTime now = timeConfiguration.now();
OffsetDateTime periodBefore = now.minusMinutes(5);

processor.parse(periodBefore, now);
processor.process(periodBefore, now);

LOGGER.info("...finished Shelly MQTT power message to instant consumption processor.");
}
Expand Down

0 comments on commit 2ca2425

Please sign in to comment.