Previously, when receiving an OPEN or CLOSE payload on an action topic, GarHAge would take that action regardless of the current state of the door. This PR changes that behaviour, so that GarHAge will now check whether the requested action (OPEN or CLOSE) is different from the current state of the door before taking action, and will not take action if the requested action matches the current state. This change makes it important that users configure their clients to send both OPEN and CLOSE payloads since it will break functionality otherwise!
Example:
OPEN is received on the action topic and the door is closed; GarHAge checks and finds that the requested state ("open") doesn't match the current state ("closed") and so triggers the open pin.
OPEN is received on the action topic and the door is open; GarHAge checks and finds that the requested state ("open") matches the current state ("open") and so does not trigger the open pin, but instead takes no action and prints a serial message informing the user.
Added code to provide that if a sanityCheck function fails (i.e. the requested action and the current state are equal) a status update is also triggered.
Previously, when receiving an OPEN or CLOSE payload on an action topic, GarHAge would take that action regardless of the current state of the door. This PR changes that behaviour, so that GarHAge will now check whether the requested action (OPEN or CLOSE) is different from the current state of the door before taking action, and will not take action if the requested action matches the current state. This change makes it important that users configure their clients to send both OPEN and CLOSE payloads since it will break functionality otherwise!
Example: