Skip to content

New LUA scripts & widgets - #3

Merged
jurgelenas merged 283 commits into
masterfrom
unified-lua-lsp
Oct 4, 2026
Merged

jurgelenas merged 283 commits into
masterfrom
unified-lua-lsp

Conversation

@jurgelenas

Copy link
Copy Markdown
Member

No description provided.

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.

jurgelenas and others added 19 commits September 28, 2026 09:28
The next CMD_QUERY is armed with now + (command.timeout or 100). 0 is
truthy in Lua, so a device that sends timeout 0 is polled on every
tick. The answer to CLICK re-arms the poll at now + 0, overriding the
response timeout execCommand set, and the POLL can reach the device
before its CONFIRMATION_NEEDED is back. The device answers READY and
the confirm dialog never shows (#16).

Treat 0 like a missing timeout and poll once per second.

Co-authored-by: Itay Sharoni <110981018+Itay-Sharoni@users.noreply.github.com>
Modules older than 3.5.4 predate the spec-compliant folders of
ExpressLRS#3123 that the parameter loader relies on; the tool sat on
the loading screen forever (#11).

DEVICE_INFO already carries the firmware version, so a TX below 3.5.4
latches session.unsupported, the same flag ELRS 1.x detection now
sets. run() checks it before tick(), so nothing more is sent to a
module the tool cannot browse. The alert just states the minimum.

The CRSF mock reports 4.1.0; the new old_firmware scenario reports
3.4.2.

Co-authored-by: Itay Sharoni <110981018+Itay-Sharoni@users.noreply.github.com>
Bind tool: on screens narrower than 400px each title gets its own
line with the controls under it, so the phrase field and Request UID
fit. The no-receiver notice and the history follow the rows in the
column instead of sitting at a fixed y offset sized for one-line rows.

VTX Admin: the portrait label column is too narrow for hints, so they
run full width under their row there. The Collection hint is now a
regular row hint like the others.

Fixes #32
A device that runs a command immediately may answer START with READY
and an info text such as "OK" or "Failed" (see the TBS CRSF spec
command sequence). The session dropped the command on READY and both
UIs closed their popup, so the text was never seen.

The session keeps a finished command's closing text in commandResult.
Colour radios show it in a new Dialogs.showInfo dialog with a Close
button, opened after the page rebuild so lvgl.clear() does not drop
it. B&W radios show it in a popup closed by ENTER or EXIT. ELRS
finishes commands with an empty info, so its commands are unchanged.

The CRSF simulator RX gets a Reset Stats command that finishes at
once with "OK".

Fixes #17
…sult-info

# Conflicts:
#	src/SCRIPTS/CRSFSimulator/csrfsimulator.lua
showInfo and buildExitDialog built the same dialog, differing only in
height and button label. Both now go through one buildDialog with a
Close button and the default height; buildExitDialog keeps the
lvgl.clear() before it.

The Dialogs functions take positional arguments instead of an options
table, so their signatures say what they need. showConfirm drops
onCancel, which no caller passed.

The CRSF simulator TX advertises 25 fields again; Reset Stats is an RX
field only.
The widget applied the 6POS boot position to the module once discovery
finished, assuming customizable switches restore their previous
position. Since EdgeTX 2.12.0 new models start SW1 on and SW2-SW6 off,
and the analog 6POS (TX16S Mk2, V16) always boots on position 1, so
every boot rewrote the module's VTX Admin to preset 1 and the module
sent it to the VTX on link-up.

The first reading from a 6POS source, at boot or after a source change,
is now recorded without a write, as the Send VTx trigger already does.
Only switch moves and collection changes retune. A move made during
discovery is still held until the widget is ready.

The lit preset cell follows the module's band and channel rather than
the switch, which can disagree after boot. When several presets match,
the switch position wins.
Off by default: the module keeps its VTX Admin channel on model load.
On: the first 6POS reading applies its preset and pushes it to the
VTX, as the link may already be up after a model switch. Useful only
where the 6POS remembers its position, e.g. TX16S Mk3 switches set to
start at Previous.
EdgeTX 2.12.3 (#7667) reports ANT 1-based; earlier versions 0-based.
Latch the base from the first 0 or 2 seen while streaming and keep
antennas 1/2 internally; fall back to the stronger RSSI until known.

X modes: path 1 is sub-GHz, path 2 is 2.4 GHz; the full-screen rows
label them SubG / 2.4. Adds an xband simulator scenario.
…ss-reboots

Keep the VTX Admin channel across reboots
The big band/channel used the theme focus colour, the same as the
selected 6POS pill below it. Secondary1 matches the title and power
text and leaves focus to the selection.

@CapnBry CapnBry left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What a night and day difference from the OG Lua. Thanks for making it all happem. Jurg!

Colour the VTX Admin band/channel like the power label
@jurgelenas
jurgelenas merged commit 268173e into master Oct 4, 2026
1 check passed
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