Skip to content

New LUA scripts & widgets - #3

Open
jurgelenas wants to merge 263 commits into
masterfrom
unified-lua-lsp
Open

jurgelenas wants to merge 263 commits into
masterfrom
unified-lua-lsp

Conversation

@jurgelenas

Copy link
Copy Markdown
Member

No description provided.

After a value write the session re-read the parent folder and its value
and INFO siblings but skipped COMMAND fields, so a command the firmware
hides or shows in response kept its stale visibility until a full
reload. Legacy elrs.lua made the same change in cc2e010; the firmware
keeps Send VTx always visible because scripts did not re-read commands.

The simulator now applies the firmware's VTX Admin visibility rules:
Channel, Pwr Lvl and Pitmode hide while Band/Enable is Disabled, and
Pitmode hides at Pwr Lvl "-". Send VTx hides with Band/Enable too,
which exercises the command re-read.
The module reboots after a phrase write, and 6 attempts (3 s) ran
out before it came back, leaving "No response" on screen. 12
attempts give it 6 s.
Re-read sibling crsf command fields after a value write
Retain legacy elrs.lua for old radios support
killEvents() refuses to mask KEY_ENTER for Lua scripts
(api_general.cpp:1699), so a long ENTER is always followed by a break
when the key is released. The editor acted on EVT_VIRTUAL_ENTER_LONG and
that break then leaked: a long press on a space committed and the break
reached the caller's row handler, which reopened the editor, and a case
toggle also advanced the cursor.

Record the long press instead and run its action on the following break,
which consumes it. Case toggling moves into _toggleCase().
…to single row and add RSNR when in non FLRC mdoe

addresses

> Telem Widget - PWR reads 0 mW when not connected but others show --
> Telem Widget - No last GPS position on disconnect? If not in your
design plans that's fine, something for later.
> Telem Widget - Fullscreen - Maybe merge RSSI 1 / RSSI 2 onto one line
so the RSNR can be added?
@jurgelenas

jurgelenas commented Sep 18, 2026 •

Copy link
Copy Markdown
Member Author

Deleting elrs.lua? Why did we add it to this repo if it wasn't going to live here? I'm fine with however we think we should handle it but this is the Lua repo so I think we should move it to a legacy folder, merge the main repo's version in here, remove it from the main repo. For this PR I'd just leave it where it is currently and then a separate PR to deal with it.

Addressed in #23

Remove edgetx-lua-stdlib

I was hoping for EdgeTX team to release official EdgeTX Lua typedefs based on my https://github.com/jurgelenas/edgetx-lua-stdlib idea. Unfortunately the progress has stalled. Will remove it later.

Bind Tool - UID_MAX_ATTEMPTS is too low, I got MANY "no response" while the module rebooted. Maybe 10-12 instead of 6?

Addressed in #25

B&W Bind - Title should be "ExpressLRS Bind" and version number goes in the EXIT string for consistency with main tools lua (use same format too?)

Addressed in #26

Why do the B&W tools scripts require an EdgeTX version? Isn't the version gating just for proper lvgl support?

I think I had more reasons for it, but the only thing that I can remember now is that we are using directories for tool scripts.

"alert" is the same thing as "dialog" except one is B&W and the other is lvgl. Should they be named the same?
Why aren't the version and nomodule messages in alert instead of multiple copies in the UI? Telemtry/VTX admin widgets fullscreen UI also duplicates the nomodule message.
The Dialogs.showNoModule minumum bauds are incorrect. These are suggested bauds. Also Baud should not be caps. It also does not include the bit about setting the "internal RF type" in sys either and perhaps F1000 should be 1000Hz because there are many 1000Hz modes.

Addressed in #27

TextEdit - No way to select next character or back up?
if event == EVT_VIRTUAL_PREV_PAGE then
self.cur = math.max(self.cur - 1, 1)
elseif event == EVT_VIRTUAL_NEXT_PAGE then
self.cur = math.min(self.cur + 1, math.min(self.maxLen, #self.value + 1))
end
TextEdit - Maybe also move the things that return true to the top and everything else that returns nil just fall through to the return nil? Also return nil is unneeded

Addressed in #28

VTX Admin top bar UI - Can it look more like a "Value" type builtin widget? Same font sizes as the builtin does, with small "VTX" and large band/channel, left aligned to match the same visual style

Good idea. I have updated telemetry widget top bar layout too.

Addressed in #29

Telem Widget - Align values vertically for PWR/BATT and TQly/TRSS.

Addressed in #30

Telem Widget - PWR reads 0 mW when not connected but others show --
Telem Widget - No last GPS position on disconnect? If not in your design plans that's fine, something for later.
Telem Widget - Fullscreen - Maybe merge RSSI 1 / RSSI 2 onto one line so the RSNR can be added?

Addressed in #31

Telem Widget - 1x4 layout TX16S with all EdgeTX bars (trim, pots, etc) still on, LQ wraps to 2 lines? Honestly it is impressive that this is the only visual glitch I ran into when testing every shape. I bet this was a ton of work to make each one look right!

Could not reproduce this one. Could you share a screenshot? What EdgetTX version you were using?

Align telemetry widget grid values per column
Add PREV_PAGE/NEXT_PAGE cursor nagivation to BW text fields
Title the bind tool "ExpressLRS Bind" and show its version like the main tool
Raise the Bind tool's UID read retries to 12
@CapnBry

CapnBry commented Sep 21, 2026

Copy link
Copy Markdown
Member

Could not reproduce this one. Could you share a screenshot? What EdgetTX version you were using?

This is my bad bug reporting to blame. I meant to type 2x4 layout not 1x4 layout.

screen-2000-01-01-000319

@CapnBry

CapnBry commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

Could not reproduce this one. Could you share a screenshot? What EdgetTX version you were using?

This is my bad bug reporting to blame. I meant to type 2x4 layout not 1x4 layout.

I would just not force the width of the LQ element as there's not enough pixels to hold the whole value. Just making it a regular label allows it to encroach into the padding and they never actually overlap. At single digit LQ the LQ will be one character to the left compared to your right-justified code but 🤷

diff --git a/src/WIDGETS/ELRSTelemetry/ui/components.lua b/src/WIDGETS/ELRSTelemetry/ui/components.lua
index 555ce15..4b7c3ee 100644
--- a/src/WIDGETS/ELRSTelemetry/ui/components.lua
+++ b/src/WIDGETS/ELRSTelemetry/ui/components.lua
@@ -915,18 +915,10 @@ function Components.compactTier(w, h, opa, m, spec)
     })
     textX = textX + detailW + m.pad * 2
   end
-  -- The reading and the status are two labels swapping over one spot, the
-  -- same mechanism as the header's mismatch banner. The reading keeps a
-  -- reserved box, right-aligned against the dBm pair; the status label is
-  -- content-sized -- a fixed box it could outgrow would wrap rather than
-  -- clip, and take the row with it -- and grows rightward across the row the
-  -- hidden readings have just emptied.
-  local heroRight = textRight - signalW - m.pad * 2
+  -- The LQ and the Status overlap entirely
   Components.label(panel, {
     x = textX,
     y = y,
-    w = math.max(1, heroRight - textX),
-    align = RIGHT,
     font = spec.heroFont,
     text = Display.lqText,

Also reading the comments in these units makes me feel like I am going insane. I like that LQ is always referred to as "Hero" and some things are "ladders" and honestly things would be a lot clearer if 90% of the comments were removed.

This is what lets a screen file declare its hero ladder as font names alone: the height half of the pair is always the measured truth.

Oh ok AI, thanks.

EDIT: Forgot the screenshot

screen-2000-01-01-000154

@jurgelenas

Copy link
Copy Markdown
Member Author

screenshot

@CapnBry I have removed a huge chunk of verbose comments.

I have also fixed how the layout width is being calculated, but that has dropped the sensitivity floor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants