Add a "Pot reset to ambient temperature" button, sim-only

New btn_pot_reset next to the ambient entry, sends {"Pot": {"Reset":
true}}; tasks/pot.py's PotTask.recv() (previously a no-op) now resets
the plant to its current ambient temperature (Pot.initial()) on that
command.

The button only appears when the server reports its Pot is simulated
(new "PlantSim" field on the System channel, derived from
config.json's previously-unused Controller.plant_name) - resetting a
simulated plant's temperature is meaningless for a real one.
This commit is contained in:
2026-06-21 12:15:35 +02:00
parent 40cf4b69cc
commit 19be2a7670
5 changed files with 36 additions and 2 deletions
+3 -1
View File
@@ -20,7 +20,9 @@ class PotTask(ATask):
asyncio.create_task(self.send({'Temp': value}))
async def recv(self, data):
pass
for pair in data.items():
if 'Reset' in pair[0]:
self.plant.initial(self.plant.theta_amb)
async def send(self, data):
await self.msg_handler.send(data)