Skip to content

Commit 8312791

Browse files
authored
Ensure temperature control stops on deactivate (#572)
1 parent e532052 commit 8312791

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pylabrobot/heating_shaking/heater_shaker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ def __init__(
3232
model=model,
3333
)
3434
self.backend: HeaterShakerBackend = backend # fix type
35+
36+
async def stop(self):
37+
await TemperatureController.stop(self)
38+
await Shaker.stop(self)

pylabrobot/temperature_controlling/temperature_controller.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ async def deactivate(self):
102102
self.target_temperature = None
103103
return await self.backend.deactivate()
104104

105+
async def stop(self):
106+
"""Stop the temperature controller and close the backend connection."""
107+
await self.deactivate()
108+
await super().stop()
109+
105110
def serialize(self) -> dict:
106111
return {
107112
**Machine.serialize(self),

0 commit comments

Comments
 (0)