Skip to content

Commit

Permalink
and even more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreKoepke committed Nov 12, 2024
1 parent 20adee2 commit cc97691
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public void buttonEventHandler(ButtonPressEvent event) {
}

private void handleButtonPressed(TimedButtonConfig config) {
if (runningJobs.containsKey(config.getButtonName())) {
var isAlreadyRunning = runningJobs.containsKey(config.getButtonName());
log.info("Timed button {} was pressed and is {}", config.getButtonName(), isAlreadyRunning ? "already running" : "not running");
if (isAlreadyRunning) {
runningJobs.get(config.getButtonName()).dispose();
runningJobs.put(config.getButtonName(), turnLightOffAfterConfiguratedTime(config));
} else {
Expand Down

0 comments on commit cc97691

Please sign in to comment.