Represents a diverter in a pinball machine.
Args: Same as the Device parent class.
Accessing diverters in code
The device collection which contains the diverters in your machine is available via
self.machine.diverters. For example, to access one called “foo”, you would use
self.machine.diverters.foo. You can also access diverters in dictionary form, e.g.
You can also get devices by tag or hardware number. See the DeviceCollection documentation for details.
Methods & Attributes
Diverters have the following methods & attributes available. Note that methods & attributes inherited from base classes are not included here.
Physically activate this diverter’s coil.
Deactivate this diverter.
This method will disable the activation_coil, and (optionally) if it’s configured with a deactivation coil, it will pulse it.
Disable this diverter.
This method will remove the hardware rule if this diverter is activated via a hardware switch.
- auto – Boolean value which is used to indicate whether this diverter disabled itself automatically. This is passed to the event which is posted.
- **kwargs – This is here because this disable method is called by whatever event the game programmer specifies in their machine configuration file, so we don’t know what event that might be or whether it has random kwargs attached to it.
Enable this diverter.
- auto – Boolean value which is used to indicate whether this diverter enabled itself automatically. This is passed to the event which is posted.
- **kwargs – unused
If an ‘activation_switches’ is configured, then this method writes a hardware autofire rule to the pinball controller which fires the diverter coil when the switch is activated.
If no activation_switches is specified, then the diverter is activated immediately.
raise_config_error(msg, error_no, *, context=None)¶
Raise a ConfigFileError exception.
Reset and deactivate the diverter.
Schedule a delay to deactivate this diverter.