def set_delayed_pulse_on_hit_rule(self, enable_switch: SwitchSettings, coil: DriverSettings, delay_ms: int):
        """Set pulse on hit and release rule to driver.

        When a switch is hit and a certain delay passed it pulses a driver.
        When the switch is released the pulse continues.
        Typically used for kickbacks.
        """
        if delay_ms <= 0:
            raise AssertionError("set_delayed_pulse_on_hit_rule should be used with a positive delay "
                                 "not {}".format(delay_ms))
        if delay_ms > 255:
            raise AssertionError("set_delayed_pulse_on_hit_rule is limited to max 255ms "
                                 "(was {})".format(delay_ms))

        self._write_hw_rule(enable_switch, coil, use_hold=False, can_cancel=False, delay_ms=int(delay_ms))