Support changing module type from LUA model.setModule() #3699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently LUA model.setModule() cannot change module type. I want to change that to enable scripts that switch between internal and external module.
User scenario 1 is using same EdgeTX model with multiple craft on multiple receiver types; currently you either need to clone the model (making modifications cumbersome, since you need to keep them in sync), or manually switch modules in the menu.
User scenario 2: this can be used to enable 'check antenna' warning for radios with removable internal module antennas - they can burn out the transmitter if the antenna isn't connected, so the user would be able to have LUA remind them to put on the antenna after the radio boots, and only enable the module (via model.setModule) once the user acknowledges the antenna is on by flipping a switch.