home-climate-control/dz

Make reactive shutdown orderly

Closed this issue · 1 comments

Expected Behavior

Upon receiving a termination signal, the system shuts down all the peripherals and then exits. Shutdown must be executed in this order:

  1. Disable WebUI and console
  2. Disconnect unit directors so they can't cause mischief
  3. Shut off HVAC devices and economizers
  4. Move dampers to "safe" position
  5. Disconnect collectors
  6. Disconnect connectors
  7. Put switches into "safe" state, if provided
  8. Cancel sensor streams subscriptions
  9. Deactivate MQTT and hardware drivers

Actual Behavior

The system relies on old behavior utilizing Autocloseable with Spring assist which wasn't reliable to begin with, and probably doesn't work at all in reactive branches.

Related Issues

#47

#271 contributed to this; the work is not done completely because there are still missing subsystems in reactive branch, but for the practical purposes it is complete.