Skip to content

Commit

Permalink
Do not turn cooler on if target temperature is higher than current
Browse files Browse the repository at this point in the history
  • Loading branch information
knro committed Oct 10, 2023
1 parent 7eb8462 commit bff9ddf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/ccd/ccd_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,10 @@ int CCDSim::SetTemperature(double temperature)
return 1;
}

CoolerS[0].s = ISS_ON;
CoolerS[1].s = ISS_OFF;
CoolerSP.s = IPS_BUSY;
auto isCooling = TemperatureRequest < temperature;
CoolerS[0].s = isCooling ? ISS_ON : ISS_OFF;
CoolerS[1].s = isCooling ? ISS_OFF : ISS_ON;
CoolerSP.s = isCooling ? IPS_BUSY : IPS_IDLE;
IDSetSwitch(&CoolerSP, nullptr);
return 0;
}
Expand Down

0 comments on commit bff9ddf

Please sign in to comment.