Add NODE_WATER_HEATER (0x41) firmware #69
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/water-heater-node"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a controller for the immersion element: one
EP_SWITCHendpoint driving a 12 V relay module through a 2N7000 open-drain on D1, failsafeFS_OFF.The runtime only had
LevelEndpoint, which acceptsCMD_LEVELand drives PWM — not something a mains relay coil should be able to receive. This addsctrl::SwitchEndpoint, a plain digital output modelled onLevelEndpointbut without dimming, fading orCMD_LEVELhandling.Node allocated at
0x41in the water range, following CONTRIBUTING.md's "Allocating a node" checklist:node_ids.h, the spec's node table,node_water_heater/main.cpp, the[env:], and the README's controllers and pin tables.Tested with
pio test -e native(443 cases, including the newtest_switch_endpointsuite) andpio run -e node_water_heater.Checked SwitchEndpoint against docs/can-protocol.md 5.1/5.2/8.3/8.4/9.3 (EP_SWITCH, CMD_SWITCH, STATE_SWITCH, failsafe) and the manual-lockout/failsafe/forward-compat invariants in CLAUDE.md — all consistent. node_ids.h's
sourceslist, the spec's node table, README's controller and pin tables, and platformio.ini'sdefault_envs/[env:node_water_heater]all stayed in lockstep, and 0x41 is a valid allocation in the Water range (0x40–0x5F) per CONTRIBUTING.md.main.cppmatches node_kitchen/node_bathroom's shape with nothing extra (no settings, no timer). Comments explain why, not what.pio test -e native -f test_switch_endpointandclang-format --dry-run --Werrorboth pass clean.test_switch_endpoint.cpp genuinely exercises the behaviour asked for: CMD_SWITCH on/off/toggle with STATE_SWITCH decode, 0xFF addressing, CMD_LEVEL correctly returning unhandled, the lockout rejecting Automation and Remote origins while still marking the endpoint dirty for re-broadcast, failsafe Off switching off on bus loss (even while inside an active lockout) and setting the failsafe flag, and MODE_SHUTDOWN switching it off.
One non-blocking nit: the tests construct the shared
ctrl::Node nodewithcan::node::water(0x40) rather thancan::node::waterHeater(0x41) — cosmetic only, doesn't affect what's being exercised.No other findings — approving would be my own PR, which Forgejo blocks, so leaving this as a comment review instead.
Nit fix confirmed.
1174169replaces everycan::node::waterwithcan::node::waterHeateracross all four sites in test_switch_endpoint.cpp (the sharednode,switchCommand, the level-command test, andlocalNodein the failsafe test). Grepped the file afterwards: no remainingcan::node::waterreferences. The commit is a clean rename, nothing else changed.Re-ran
pio test -e native: 443/443 pass, includingtest_switch_endpoint. clang-format clean on all touched files. Glanced over the rest of the branch diff (node_ids.h, platformio.ini, README, spec, SwitchEndpoint, node_water_heater/main.cpp) — nothing new since the last pass.Clean to merge (can't self-approve, so leaving this as a comment review rather than APPROVED).