Commit Graph
19 Commits
Author SHA1 Message Date
jensandClaude Sonnet 5 7b162cf1f5 refactor: drop firmware-version display, move Enable toggle to Controller
Firmware version is already printed to the log at connect() time
(HendiCtrl/Pololu1376) - remove the live GUI/websocket firmware
reporting entirely (Connectable, HeaterHendi/StirrerPololu1376,
Heater/StirrerTask, web GUI) as redundant.

Also move the Heater panel's Closed-loop checkbox into the Controller
panel and rename it "Enable" - the Controller panel now shows a
live Enabled (green) / Disabled (gray) status badge next to its
heading, matching the Connected/Disconnected badges on the Heater/
Stirrer panels.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaPLuRPpyjWcwhMvCvpHCL
2026-07-03 20:23:55 +02:00
jensandClaude Sonnet 5 0877e7754b fix: guard HeaterHendi/StirrerPololu1376 activate() against comm errors
Live-testing on the brewpi Pi found that a connected-but-unresponsive
device (e.g. the hendi sitting in its ungraceful-disconnect lockout, see
docs/hendi_lockout_findings.md) crashed the whole server: activate() -
called both from HeaterTask's `with device.open():` and from a client's
Connect/Disconnect command - raised uncaught, escaping the gathered task
and killing the entire asyncio.gather in TaskManager.start().

activate()/is_activated()/process() on both real actors now catch comm
exceptions and self-heal via disconnect() (the same path a genuine
unplug already takes), instead of letting the exception propagate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaPLuRPpyjWcwhMvCvpHCL
2026-07-03 19:39:07 +02:00
jensandClaude Sonnet 5 f20e617d81 feat: add connect/disconnect status for real heater/stirrer hardware
Heater and Stirrer can be real serial hardware (hendi, Pololu1376), but
there was no connection concept at all - the constructors opened the
port and crashed the whole server if the device was missing, with no
way to see connection status or firmware version and no way to
reconnect without a restart.

Adds an observable Connectable mixin (components/connectable.py) shared
by AHeater/AStirrer; real devices defer opening the serial port to an
explicit connect(), auto-connect on server startup, and surface
Connected/FirmwareVersion/Simulated plus manual Connect/Disconnect over
the web GUI. Heating/stirring and Sud Start are all gated on connection
state, and a disconnect mid-brew force-stops the run via the same path
as a manual Stop.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YaPLuRPpyjWcwhMvCvpHCL
2026-07-03 19:18:59 +02:00
jensandClaude Sonnet 4.6 5751d26873 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>
2026-06-30 18:26:54 +02:00
jens bd63f2648c - refactored hendi_ctrl
- fixed hend_heater
- added workaround for typedDict and Python < v3.8
2021-10-19 06:32:45 +01:00
jens 9b997b8348 - generalized heaters 2021-10-18 14:32:56 +02:00
jens a20de855ac - set heater power to zero at startup 2020-12-19 16:47:01 +01:00
jens c8660ca60e - fixed hendi power 2020-12-18 17:03:17 +01:00
jens 1cfcd76c0b - fixed hendi power 2020-12-18 16:37:37 +01:00
jens 4e508c86c5 - redefine activate method
- for task introduced open() conext method
2020-12-18 15:58:02 +01:00
jens a3510ffe8f - hendi: remote enable on activate 2020-12-17 21:57:02 +01:00
jens 850ad6c88c - hendi: remote enable on activate 2020-12-17 21:53:28 +01:00
jens eb9d7f5159 - fixed init order 2020-12-17 21:48:41 +01:00
jens 3b059181c5 - import hendiCtrl 2020-12-17 21:46:23 +01:00
jens 292d946393 - fixed hendi power 2020-12-17 21:39:09 +01:00
jens 9ddcd547d1 - fixed args 2020-12-17 17:33:38 +01:00
jens ddf8003f5c - refactored
- integrated stirrer
2020-12-17 16:28:50 +01:00
jens fa93a3911e - refactored 2020-12-16 17:10:46 +01:00
jens 0cb958938f - added stirrer and hendi
- refactored
2020-12-16 16:52:32 +01:00