Skip to content

feat: add support for a new "Master/Lua" trainer mode#7160

Open
Amigache wants to merge 6 commits into
EdgeTX:mainfrom
Amigache:new-trainer-integration-from-lua
Open

feat: add support for a new "Master/Lua" trainer mode#7160
Amigache wants to merge 6 commits into
EdgeTX:mainfrom
Amigache:new-trainer-integration-from-lua

Conversation

@Amigache

@Amigache Amigache commented Mar 9, 2026

Copy link
Copy Markdown

This pull request introduces a new "Master/Lua" trainer mode to both the companion and radio firmware, enabling trainer input channels to be set via Lua scripts. The changes include updates to enums, translation files, YAML serialization, availability checks, and new Lua API functionality. The implementation ensures the new mode is only available when Lua support is present and provides proper initialization and stopping behavior.

Addition of "Master/Lua" trainer mode:

  • Added TRAINER_MODE_LUA to the TrainerMode enum in both modeldata.h and dataconstants.h, updated related macros, and integrated it into YAML serialization tables for both companion and radio firmware. [1] [2] [3] [4]

Trainer mode availability and translation updates:

  • Updated trainer mode availability checks in both companion and radio firmware to conditionally enable "Master/Lua" only when Lua support is present. [1] [2]
  • Added "Master/Lua" translations to all supported languages. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Lua API enhancements:

  • Introduced the setTrainerChannels Lua function, allowing scripts to set trainer input channels when in "Master/Lua" mode, and registered it in the Lua API. [1] [2]

Trainer mode handling:

  • Updated stopTrainer and checkTrainerSettings to properly handle the new "Master/Lua" mode, including resetting inputs and skipping hardware initialization. [1] [2]

User interface and string updates:

  • Updated string conversion functions in the companion firmware to recognize and display "Master/Lua" mode.

Can work with this related proyect:
https://github.com/Amigache/BTWifiSerial/tree/develop

@Amigache Amigache changed the title New support for a new "Master/Lua" trainer mode Support for a new "Master/Lua" trainer mode Mar 9, 2026
@Amigache

Copy link
Copy Markdown
Author

Companion integration done.

@3djc

3djc commented Mar 10, 2026

Copy link
Copy Markdown
Collaborator

Sounds like a painfully slow way of proceeding: you need 8 calls to perform a simple 8ch trainer channel data fill

@Amigache

Copy link
Copy Markdown
Author

Sounds like a painfully slow way of proceeding: you need 8 calls to perform a simple 8ch trainer channel data fill

Good observation. I've tried it on my TX16S and it works very well, but I think perhaps a method that maps all the channels at once, in a bulk operation, would be better, don't you think?

@pfeerick pfeerick changed the title Support for a new "Master/Lua" trainer mode feat: add support for a new "Master/Lua" trainer mode Mar 11, 2026
@pfeerick pfeerick added enhancement ✨ New feature or request and removed needs: companion labels Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants