Skip to content

Commit

Permalink
Minor refactoring (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
climategadgets committed Aug 19, 2023
1 parent 7bfed51 commit 035b760
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public Flux<Signal<HvacDeviceStatus, Void>> compute(Flux<Signal<HvacCommand, Voi
return Flux.concat(init, in, shutdown)
.filter(Signal::isOK)
.filter(ignored -> !isClosed())
.doOnNext(this::checkInitialMode)
.flatMap(s -> Flux.create(sink -> process(s, sink)));
}

Expand All @@ -174,7 +175,6 @@ private void process(Signal<HvacCommand, Void> signal, FluxSink<Signal<HvacDevic

logger.debug("process: {}", signal);

checkInitialMode(signal);
trySetMode(signal, sink);
setOthers(signal, sink);

Expand All @@ -195,7 +195,7 @@ private void checkInitialMode(Signal<HvacCommand, Void> signal) {
&& signal.getValue().mode == null
&& signal.getValue().demand > 0) {

throw new IllegalStateException("Can't accept demand > 0 before setting the operating mode");
throw new IllegalStateException("Can't accept demand > 0 before setting the operating mode, signal: " + signal);
}
}

Expand Down

0 comments on commit 035b760

Please sign in to comment.