thorrak / brewpi-esp8266

An implementation of the BrewPi device code on the ESP8266, ESP32, and ESP32-S2
GNU General Public License v3.0
86 stars 30 forks source link

Deleting Actuator does not Deactivate Pin #62

Closed lbussy closed 1 year ago

lbussy commented 3 years ago

If you add an actuator, then delete it, the state it had when it was defined persists.

  1. Add an actuator
  2. Actuator gains a state
  3. Delete actuator
  4. Actuator does not revert to a deactivated state

For example:

  1. Add D0 as a heat relay and set it as "non-inverted"
  2. Observe the relay energize
  3. Delete the device
  4. The relay stays active
thorrak commented 2 years ago

I think there are two separate issues here:

An actuator does not deactivate when deleted

This is a legitimate issue. I'm adding an explicit toggle off to the "device uninstall" code.

A user sets a relay with the incorrect inversion state, resulting in inadvertent activation

If a user adds a relay with an incorrect inversion state, the control algorithm will attempt to toggle the relay "off" - but apply the inversion state and end up inadvertently turning the relay on. This is correct behavior, as the controller is following the user's instructions when attempting to turn off the relay. This cannot be corrected for.