mpf icon indicating copy to clipboard operation
mpf copied to clipboard

remove show token validation

Open GabeKnuth opened this issue 9 years ago • 3 comments

(This is Brian on Gabe's laptop)

If you pass an unexpected token to a show, it will raise an error. This is a problem with shots, for example, we have a shot like this:

shots:
    left_kicking_target:
        switch: s_bottomkickingtarget
        show_tokens:
            led: l_left_longhorn
            color: ffcc00

shot_profiles:
    advertise:
      states:
        - name: flashing
          show: flash_color
          speed: 10
        - name: unlit
          show: off
      loop: yes

shows:
    flash_color:
        - time: 0
          leds:
            (led):
              color: (color)
            (leds):
              color: (color)
        - time: 1
          leds:
            (led):
              color: black
            (leds):
              color: black
        - time: 2

So the we have a generic show where we can flash a color that we pass which is nice. But we can't use the "off" show. And we can't make an off show which accepts our color token because where in the show do we put that?

Removing the following lines fixes it: https://github.com/missionpinball/mpf/blob/0.31/mpf/assets/show.py#L338-L341

GabeKnuth avatar Sep 23 '16 16:09 GabeKnuth

Maybe just add a call path for shots which allow optional tokens? It makes sense at other locations to have this validation.

We should talk about play_kwargs in shows at Expo.

jabdoa2 avatar Sep 23 '16 16:09 jabdoa2

Sounds easy. I'm fine with this.

toomanybrians avatar Sep 23 '16 18:09 toomanybrians

disable validation in the show, add validation in the shot

toomanybrians avatar Oct 12 '16 15:10 toomanybrians