Skip to content

Hide VTXAdmin lua fields if disabled - #3608

Merged
pkendall64 merged 5 commits into
ExpressLRS:masterfrom
CapnBry:vtxadmin-hide
Apr 29, 2026
Merged

pkendall64 merged 5 commits into
ExpressLRS:masterfrom
CapnBry:vtxadmin-hide

Conversation

@CapnBry

@CapnBry CapnBry commented Apr 14, 2026 •

Copy link
Copy Markdown
Member

Hides the VTX Channel, VTX Power, VTX Pit Mode fields if VTX Admin is disabled. Also changes "Off" option to "Disabled" and the label to include the fact that Band is also used to enable the feature.

Details

It has come to my attention now from a couple different people that they did not understand that setting the Band to Off in VTX Admin disabled the feature, opting to jump straight to the "Channel" field and then being confused why it never worked. Who can blame them, there's really just 1 band as far as anyone is concerned. This tries to make it clearer by hiding the Channel field until the Band is set, and updating the label to assist in that discovery.

I'd love to hide [Send VTX] as well, but the lua doesn't check COMMAND type fields for updates when a value changes. We could also change that, but I can see that being a major issue if most don't update their lua and suddenly Send VTX isn't there unless they exit and come back.

Instead, when you [Send VTX] now instead of saying Sending... it will say Not enabled. This is better than nothing?

B&W Screens

The new "Band/Enable" label has 1 space after it before the value so this still fits. I'm open to changing this label but it has to be at most this many characters.

image

@CapnBry CapnBry added enhancement 🪄 New feature or request V4.1 🍑 labels Apr 14, 2026
@pkendall64

Copy link
Copy Markdown
Collaborator

I'd love to hide [Send VTX] as well, but the lua doesn't check COMMAND type fields for updates when a value changes. We could also change that, but I can see that being a major issue if most don't update their lua and suddenly Send VTX isn't there unless they exit and come back.

We could make it reload FOLDER and COMMAND types as well, just make the check <= 13

and (fldType < 11 or fldType == 12) then -- ignores FOLDER/COMMAND/devices/EXIT

@CapnBry

CapnBry commented Apr 18, 2026 •

Copy link
Copy Markdown
Member Author

We could make it reload FOLDER and COMMAND types as well, just make the check <= 13

Yeah we could but we can't. What I was trying to say is that we can't rely on people updating their Lua, therefore we have to code this in the safer way which is assuming that the user did not update their Lua. If the user:

  • Quad is already plugged in and running, VTX Admin is off.
  • User needs to change their VTX setting.
  • Goes into VTX Admin and turns it on by setting the Band to R.
    • Channel, Power Level, Pit Mode appears.
    • User has not updated their Lua, Send VTX does not appear
  • User is confused. Not presented with the option to Send now that it is enabled, the user does not understand why their VTX hasn't changed. ExpressLRS is garbage and VTX Admin never works right.

That's why I chose to keep Send VTX always visible, because I'd rather have it always visible regardless of how old the lua script is so there isn't a "blame the user for not updating" issue. Having it visible all the time isn't as bad as it not working and then telling them it is their fault.

EDIT: Or do you think I should change the lua as well so it refreshes commands, then we circle back to that line of code in a year or two and assume that folks will have updated their lua at least once in that time? I made it not refresh commands back in the day in order to make the update as fast as possible and didn't consider visibility changes at the time since we didn't really use them at all back then.

@pkendall64

Copy link
Copy Markdown
Collaborator

Yeah, if we do both then it works nicer for folk that do update their Lua script. And the lazy sods see the error message.

@CapnBry

CapnBry commented Apr 19, 2026

Copy link
Copy Markdown
Member Author

And the lazy sods see the error message.

But the issue is that the initial state when turning it on has Send VTX hidden. When you turn it on, you don't see the Send VTX at all because it isn't refreshing, so the user will just think it isn't working because their change can't be committed to the VTX.

@pkendall64

Copy link
Copy Markdown
Collaborator

And the lazy sods see the error message.

But the issue is that the initial state when turning it on has Send VTX hidden. When you turn it on, you don't see the Send VTX at all because it isn't refreshing, so the user will just think it isn't working because their change can't be committed to the VTX.

Ah, I see what you are saying now. If the admin is disabled and the button is hidden, then they enable admin we don't refresh the button in the Lua (cause they haven't upgraded), so they don't see the button till they exit the Lua script, then come back.

Guess they really should follow the upgrade instructions and update the Lua then too 😓

@mha1 mha1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as advertised on T15/Nomad

@pkendall64
pkendall64 merged commit cf582b1 into ExpressLRS:master Apr 29, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 🪄 New feature or request V4.1 🍑

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants