Simplify power state
authorSven Rademakers <sven.rademakers@gmail.com>
Mon, 6 Nov 2023 12:50:06 +0000 (12:50 +0000)
committerSven Rademakers <sven.rademakers@gmail.com>
Mon, 6 Nov 2023 13:01:44 +0000 (13:01 +0000)
commitd5db79d67ec725fa0a2da578f7be4f33dc1b0c57
tree47a77792ecae264455350f2bbd15f52b2251eb81
parent1c7eb45809992f8548260cf8539907cf87acb037
Simplify power state

Previously, an attempt was made to make a power controller with a on
and off state. The "on" state had a sub-state where nodes could be
activated, they were participating in the on/off state
toggling. Power commands to nodes that were 'deactivated` were omitted.

After some trial and error, its concluded that for the end user its
confusing as:
* there is no real way to detect if a module is inserted at a slot and
  therefore can be labeled as active. As a fallback it was up to the
  user to flag a given node as active.
* there was no easy way to see if a node was/is active and to what state
  it will go when an global on or off command was given

The global power state is removed and the interface is simplified.
* on restart the previous power-state prior reboot is restored
* pressing KEY_1 will toggle all nodes on if 3 or less nodes are powered
  on
* pressing KEY_1 when all nodes are off will turn all nodes on
* pressing KEY_1 when all nodes are on will turn all nodes off
* long press KEY_1 will force every node to on
* the API does not cache a global state, command `on --node 1` will turn
  node 1 on etc
src/app/bmc_application.rs
src/app/firmware_runner.rs
src/persistency/app_persistency.rs