-
Notifications
You must be signed in to change notification settings - Fork 26
report pausedSteam and puffing as themselves, not as idle - #800
Open
ChampionDesigns wants to merge 1 commit into
Open
report pausedSteam and puffing as themselves, not as idle #800ChampionDesigns wants to merge 1 commit into
ChampionDesigns wants to merge 1 commit into
Conversation
`mapDe1SubToMachineSubstate` collapsed five raw DE1 substates onto `MachineSubstate.idle`. Two of them are steam phases a caller has a real reason to tell apart: pausedSteam (0x12) the valve is shut and the session is not over puffing (0x14) the purge after steam stops on time or on milk temperature Reported as `idle`, neither could be shown, and a client could not distinguish a pause from a purge from a machine doing nothing at all. The purge matters most: it can hold for a while, and a screen that cannot name it leaves someone watching a machine that looks stopped and is not. `noState`, `userNotPresent` and `refill` still map to `idle` — they carry no phase a caller can act on. WHAT THIS COULD HAVE BROKEN, AND DOES NOT. `shot_sequencer` ends a shot when the substate reads `pouringDone` or `idle`, so a steam session arriving as `idle` used to satisfy it. It never reaches that branch: the sequencer leaves `idle` only on `espresso` + `preparingForShot`, and aborts in `preheating` if the state is not espresso, so steam never enters `ShotState.pouring`. Every other reader compares against a specific substate rather than switching exhaustively. dart format clean over the diff, flutter analyze clean, flutter test 3727 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mapDe1SubToMachineSubstatecollapsed five raw DE1 substates ontoMachineSubstate.idle. Two ofthem are steam phases a caller has a real reason to tell apart:
Reported as
idle, neither could be shown, and a client could not distinguish a pause from a purgefrom a machine doing nothing at all. The purge matters most: it can hold for a while, and a
screen that cannot name it leaves someone watching a machine that looks stopped and is not.
noState,userNotPresentandrefillstill map toidle— they carry no phase a caller can acton.
Base:
main. Independent. Two files, 15 lines.What this could have broken, and does not
shot_sequencerends a shot when the substate readspouringDoneoridle, so a steam sessionarriving as
idleused to satisfy it. It never reaches that branch: the sequencer leavesidleonly on
espresso+preparingForShot, and aborts inpreheatingif the state is not espresso,so steam never enters
ShotState.pouring. Every other reader compares against a specific substaterather than switching exhaustively.
Linked Issue
N/A
Verification
flutter analyze— clean.flutter test— full suite 3891 passed against currentmain.dart format— clean on every changed file.The sequencer reasoning above was checked against the code, not assumed.
Verified on hardware. This change ships in the Decaid-Canary build Ben runs on his own
machine, and has been exercised in normal use rather than only under test.
Impact
MachineSubstategains two values that were previously reported asidle. A clientswitching exhaustively on the enum must handle them.
"not a substate I know" as idle keeps today's behaviour.
Contributor Responsibility
AI-assisted development is allowed. The submitter remains responsible for the submitted work.