test / test (push) Has been cancelled
The gate-reset condition was matching Mode.OFF (sub_mode=DISABLED, write_action=NONE) and clearing last_desired_amps each tick, causing the next tick to re-issue switch.turn_off. Disambiguate by checking desired_amps is None — only the true gate-closure path returns None. Also removes now-unused SubMode import from coordinator.py.