Skip to content

Commit

Permalink
optimized logging and taring
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanSST committed Mar 21, 2024
1 parent 91b586a commit 9f72b9a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/main/java/ch/stephan/chickenfarm/scale/ScaleService.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ public class ScaleService {
private MqttPublisherService mqttPublisherService;

public int measureWeight(String uid) {
int weight = boxService.getBox(uid).getWeight();
log.info("Scale {} has weight {}g.", uid, weight);
return weight;
return boxService.getBox(uid).getWeight();
}

public String calibrate(String uid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ private void measureWeightOfScale(Box box) {
dateFormat.format(new Date()));
box.setBoxState(BoxState.EMPTY);
box.setChicken(null);
scaleService.tare(box.getId());
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ schedulerservice:
observer:
cron: "0 * 6-20 * * *"
tare:
cron: "17,47 * 6-20 * * *"
cron: "17 * 6-20 * * *"
morning:
cron: "3 0 5 * * *"

Expand Down

0 comments on commit 9f72b9a

Please sign in to comment.