self.machine.gis.*¶
-
class
mpf.devices.gi.
Gi
(self_inner, *args, **kwargs)¶ Bases:
mpf.core.system_wide_device.SystemWideDevice
Represents a light connected to a traditional lamp matrix in a pinball machine.
This light could be an incandescent lamp or a replacement single-color LED. The key is that they're connected up to a lamp matrix.
Accessing gis in code
The device collection which contains the gis in your machine is available via
self.machine.gis
. For example, to access one called "foo", you would useself.machine.gis.foo
. You can also access gis in dictionary form, e.g.self.machine.gis['foo']
.You can also get devices by tag or hardware number. See the DeviceCollection documentation for details.
Methods & Attributes
Gis have the following methods & attributes available. Note that methods & attributes inherited from base classes are not included here.
-
add_handler
(callback)¶ Register a handler to be called when this GI changes state.
-
disable
(**kwargs)¶ Disable this GI string.
-
enable
(brightness=255, **kwargs)¶ Enable this GI string.
Parameters: - brightness -- Int from 0-255 of how bright you want this to be. 255 is on. 0 os iff. Note that not all GI strings on all machines support this.
- fade_ms -- How quickly you'd like this GI string to fade to this brightness level. This is not implemented.
-
remove_handler
(callback=None)¶ Remove a handler from the list of registered handlers.
-