<commit_before>blinkenlight_player:
====================

*Config file section*

+----------------------------------------------------------------------------+---------+
| Valid in :doc:`machine config files </config/instructions/machine_config>` | **YES** |
+----------------------------------------------------------------------------+---------+
| Valid in :doc:`mode config files </config/instructions/mode_config>`       | **YES** |
+----------------------------------------------------------------------------+---------+

.. note:: This section can also be used in a show file in the ``blinkenlights:`` section of a step.

.. overview

The ``blinkenlight_player:`` section of your config is where you add or remove
colors to or from a blinkenlight based on events. It's also used in shows
(via the ``blinkenlights:`` section) to add or remove colors in that show step.

Example from a config file:

.. code-block:: mpf-config

    blinkenlight_player:
      some_event:
        my_blinkenlight1:
          action: add
          color: red
          key: mykey1
      mode_ended:
        my_blinkenlight1:
          action: remove
          key: mykey1

In the example above, when the event called ``some_event`` is posted,
the color red will be added to my_blinkenlight1's list of colors (this will
cause the light to immediately start flashing if it wasn't already).  The new
color will have the key ``mykey1``.  The key is used like a name of the color,
so that it can be removed later.
When the event ``mode_ended`` is posted, the red color (key ``mykey1``) will be
removed from the blinkenlight.

Example blinkenlight player from a show:

.. code-block:: mpf-config

    ##! show: test
    - time: 0
      blinkenlights:
        my_blinkenlight1:
          action: add
          color: blue
          key: blue_color
        my_blinkenlight2: purple

The first example shows the full config, while the second shows the
"express" config. (What's an "express config?" Details :doc:`here </config/instructions/express_config>`.

The blinkenlight player's express config is the "add" action.  Note that the
express config uses a random key, so there's no way for you to remove this
color with the ``remove`` action if you use this config. However, all colors added
to a blinkenlight by any mode are removed automatically when the mode ends.

See :doc:`/config_players/blinkenlight_player` for details.

.. config


Optional settings
-----------------<commit_msg>Changed the name of the mode_ended event to avoid confusion, since colors are removed by default anyway on mode_ended.<commit_after>blinkenlight_player:
====================

*Config file section*

+----------------------------------------------------------------------------+---------+
| Valid in :doc:`machine config files </config/instructions/machine_config>` | **YES** |
+----------------------------------------------------------------------------+---------+
| Valid in :doc:`mode config files </config/instructions/mode_config>`       | **YES** |
+----------------------------------------------------------------------------+---------+

.. note:: This section can also be used in a show file in the ``blinkenlights:`` section of a step.

.. overview

The ``blinkenlight_player:`` section of your config is where you add or remove
colors to or from a blinkenlight based on events. It's also used in shows
(via the ``blinkenlights:`` section) to add or remove colors in that show step.

Example from a config file:

.. code-block:: mpf-config

    blinkenlight_player:
      some_event:
        my_blinkenlight1:
          action: add
          color: red
          key: mykey1
      some_other_event:
        my_blinkenlight1:
          action: remove
          key: mykey1

In the example above, when the event called ``some_event`` is posted,
the color red will be added to my_blinkenlight1's list of colors (this will
cause the light to immediately start flashing if it wasn't already).  The new
color will have the key ``mykey1``.  The key is used like a name of the color,
so that it can be removed later.
When the event ``some_other_event`` is posted, the red color (key ``mykey1``) will be
removed from the blinkenlight.

Example blinkenlight player from a show:

.. code-block:: mpf-config

    ##! show: test
    - time: 0
      blinkenlights:
        my_blinkenlight1:
          action: add
          color: blue
          key: blue_color
        my_blinkenlight2: purple

The first example shows the full config, while the second shows the
"express" config. (What's an "express config?" Details :doc:`here </config/instructions/express_config>`.

The blinkenlight player's express config is the "add" action.  Note that the
express config uses a random key, so there's no way for you to remove this
color with the ``remove`` action if you use this config. However, all colors added
to a blinkenlight by any mode are removed automatically when the mode ends.

See :doc:`/config_players/blinkenlight_player` for details.

.. config


Optional settings
-----------------
{'fraction_non_alphanumeric': 0.18768560681053256, 'fraction_numerical': 0.0039596119580281135, 'mean_word_length': 2.213740458015267, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4415148', 'n_tokens_mistral': 1324, 'n_tokens_neox': 1295, 'n_words': 576}