maartentamboer / X-Touch-Mini-FS2020

Control FS2020 with a Behringer X-Touch Mini
https://dev-tty.nl/X-Touch-Mini-FS2020/
MIT License
57 stars 19 forks source link

"mobiflightsimvar_led" improvements #112

Open vicentezc opened 2 years ago

vicentezc commented 2 years ago

Hello,

I am working on a config for the PMDG737 and I have noticed that the "mobiflightsimvar_led" feature doesn't always work well because in some cases the "ON" value is different than 1. Is there a way to make an improvement so that the "ON" value can be set along with the variable? Example: "mobiflightsimvar_led": "(L:switch_3801_73X) == 0.5"

Thanks! Vicente

mkx173 commented 2 years ago

I actually implemented this locally but haven't submit a pull request because there are two options and I don't know which one is better. The first option is that the led is off when the value is 0 and on otherwise, and you can set additional values where the led will stay off. The second option is the led is always off and you can add values that will turn on the led. Which one do you think is better?

Or additionally I can make it a jinja2 script, but maybe that's an overkill.

vicentezc commented 2 years ago

So as an example, I noticed that the state of the ATHR ARM switch in the PMDG 737 can be determined using two variables with the following values: | ATHR ARM Position | ARMED | OFF | | L:switch_3801_73X | 0.5 | 0 | | L:switch_380_73X | 0 | 100 |

This shows that in some cases, we may want the led ON when the Lvar is 0 (I don't understand why PMDG made that choice). So in the first option, if the led was off with value of L:switch_380_73X == 0, that wouldn't work. I think it's more intuitive to define the value(s) for the led to be ON. It could be either a list of 1-N values (e.g. for switches with more than 2 positions), or when value is greater/lower than X. I guess that would cover most cases. Then of course, if no value is defined, the current default would apply (Off = 0 / On = 1).

Thanks!