the obvious way is note when a relay state change occurs
then inhibit any further state change until a determined period has elapsed