diff --git a/pioreactor/background_jobs/led_automation.py b/pioreactor/background_jobs/led_automation.py index 6493ade4..6bbc758c 100644 --- a/pioreactor/background_jobs/led_automation.py +++ b/pioreactor/background_jobs/led_automation.py @@ -171,7 +171,7 @@ def set_led_intensity(self, channel: pt.LedChannel, intensity: pt.LedIntensityVa A float between 0-100, inclusive. """ - attempts = 12 + attempts = 6 for _ in range(attempts): success = led_intensity( {channel: intensity}, diff --git a/pioreactor/background_jobs/od_reading.py b/pioreactor/background_jobs/od_reading.py index 81c8e4f6..4b9c5e69 100644 --- a/pioreactor/background_jobs/od_reading.py +++ b/pioreactor/background_jobs/od_reading.py @@ -981,7 +981,7 @@ def _determine_best_ir_led_intensity( initial_ir_intensity / culture_on_signal * 3.0 ) / 50 # divide by N since the culture is unlikely to Nx. - ir_intensity_max = 85.0 + ir_intensity_max = 80.0 return min(ir_intensity_max, ir_intensity_argmax_ANGLE_can_be, ir_intensity_argmax_REF_can_be) def _prepare_post_callbacks(self) -> list[Callable]: diff --git a/pioreactor/tests/test_temperature_automation.py b/pioreactor/tests/test_temperature_automation.py index d194ce03..656abcd4 100644 --- a/pioreactor/tests/test_temperature_automation.py +++ b/pioreactor/tests/test_temperature_automation.py @@ -117,6 +117,20 @@ def test_setting_pid_control_after_startup_will_start_some_heating() -> None: assert t.heater_duty_cycle > 0 +def test_setting_heat_is_turned_off_when_paused() -> None: + # this test tries to replicate what a user does in the UI + experiment = "test_setting_pid_control_after_startup_will_start_some_heating" + with Thermostat(unit=unit, experiment=experiment, target_temperature=35) as t: + pause(2) + assert t.state == t.READY + assert t.heater_duty_cycle > 0 + + t.set_state(t.SLEEPING) + + assert t.state == t.SLEEPING + assert t.heater_duty_cycle == 0 + + def test_duty_cycle_is_published_and_not_settable() -> None: experiment = "test_duty_cycle_is_published_and_not_settable" dc_msgs = []