server: graceful Ctrl-C shutdown; HendiCtrl closes connection cleanly

On KeyboardInterrupt, brewpi.py cancels all asyncio tasks (letting
HeaterTask's `with device.open()` finally block run), then calls
heater.close() as belt-and-suspenders before closing the event loop.

On shutdown HeaterHendi.activate(False) now sets the switch to 0 instead
of disabling remote control, so the Hendi stays in remote mode at 0 W
rather than dropping back to its local panel state.  HendiCtrl.close()
does the same (setSwitch(0)) then closes the serial port.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-30 18:26:54 +02:00
co-authored by Claude Sonnet 4.6
parent 29dd5267a9
commit 5751d26873
4 changed files with 33 additions and 2 deletions
+3
View File
@@ -20,6 +20,9 @@ class AHeater(AttributeChange):
def get_powers(self):
pass
def close(self):
pass
@contextmanager
def open(self):
try: