You removed the "Set" control mode. I use these to distinguish actual mode from the mode being requested by a call to a Set function. Set function sets drainPumpControlMode and state machine (off state) sets drainPumpControlModeSet if/when it executes the request and actually starts the pump.
In f/w, I like to keep percentages as per unit so that the math works - e.g. if I need to apply percentage to something I can just multiply it directly. On Dialin side, I kept as percentage.
The reason this has been added is somewhat complicated to explain. But one of the reasons is so the next time we enter pre-treatment the top page is the create treatment page and not the treatment begin page. I've made a note to follow up on this
We should think about this. I'm ok with adding an explicit transition out handler (similar to the existing transition to handler), but if we do this we should build this into all modes (DG and HD). To date, I've not required any clean-up on way out of a mode - mode can be reset on next entry. That seems to have been working so far. Valve positions and motor states should be set as appropriate on entry to next mode, so we shouldn't have to worry about these kind of things on way out of a mode.