MQTT Cover - Custom State Machine

Hi.

I have a Shelly 1 controlling the Open / Stop / Close function of my garage door. Everything is working nicely except the logic that controls the state of the garage door when it’s instructed to ‘stop’.

When the cover is in either ‘opening’ or ‘closing’ state and a ‘stop’ instruction is sent. The cover immediately moves to the ‘open’ state and the only option is to ‘close’ the cover. However the way my garage door OSC terminal works is such that when the garage is in the stopped state, any subsequent command will reverse the previous direction of the door.

Example (where arrow indicates a signal sent to the door):
Closing → Stopped (Open) → Opening
Opening → Stopped (Closed) → Closing

The state machine of the cover assumes the opposite logic though. It assumes that my cover can continue its direction prior to the stop command being sent.

Is there any way to reverse this logic?

(Additionally, I’m not sure why the default state of the garage door is to be ‘Closed’ after receiving a stop command during closing)