Skip to content

Commit

Permalink
Removed redundant argument (#238, #290)
Browse files Browse the repository at this point in the history
  • Loading branch information
climategadgets committed Oct 11, 2023
1 parent f6b64f0 commit d09a207
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,12 @@ public abstract class AbstractEconomizer <A extends Comparable<A>> implements Si
/**
* Create an instance.
*
* Note that only the {@code ambientFlux} argument is present, indoor flux is provided to {@link #compute(Flux)}.
*
* @param ambientFlux Flux from the ambient temperature sensor.
* @param targetDevice Switch to control the economizer actuator.
*/
protected AbstractEconomizer(
Clock clock,
String name,
EconomizerSettings settings,
Flux<Signal<Double, Void>> ambientFlux,
Switch<A> targetDevice) {

this.clock = clock == null ? Clock.systemUTC() : clock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public SimpleEconomizer(
Flux<Signal<Double, Void>> ambientFlux,
Switch<A> targetDevice) {

super(null, name, settings, ambientFlux, targetDevice);
super(null, name, settings, targetDevice);

initFluxes(ambientFlux);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public PidEconomizer(
Flux<Signal<Double, Void>> ambientFlux,
Switch<A> targetDevice) {

super(clock, name, settings, ambientFlux, targetDevice);
super(clock, name, settings, targetDevice);

controller = new SimplePidController<>("(controller) " + getAddress(), 0, settings.P, settings.I, 0, settings.saturationLimit);
signalRenderer = new HysteresisController<>("(signalRenderer) " + getAddress(), 0, HYSTERESIS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void targetAdjustmentTest(TargetAdjustmentTestData source) {
true,
1.0, 0.0001, 1.0);

var e = new TestEconomizer("eco", settings, Flux.empty(), new NullSwitch(""));
var e = new TestEconomizer("eco", settings, new NullSwitch(""));

var signal = e.computeCombined(source.indoorTemperature, source.ambientTemperature);

Expand All @@ -45,11 +45,10 @@ private class TestEconomizer extends AbstractEconomizer<String> {
* <p>
* Note that only the {@code ambientFlux} argument is present, indoor flux is provided to {@link #compute(Flux)}.
*
* @param ambientFlux Flux from the ambient temperature sensor.
* @param targetDevice Switch to control the economizer actuator.
*/
protected TestEconomizer(String name, EconomizerSettings settings, Flux<Signal<Double, Void>> ambientFlux, Switch<String> targetDevice) {
super(Clock.systemUTC(), name, settings, ambientFlux, targetDevice);
protected TestEconomizer(String name, EconomizerSettings settings, Switch<String> targetDevice) {
super(Clock.systemUTC(), name, settings, targetDevice);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void dropToOnAndBack() {
var sinkWrapper = new SinkWrapper<Signal<Double, Void>>();
var deferredAmbientFlux = Flux.create(sinkWrapper::connect);

var economizer = new SimpleEconomizer<String>(
var economizer = new SimpleEconomizer<>(
"economizer",
settings,
deferredAmbientFlux,
Expand Down

0 comments on commit d09a207

Please sign in to comment.