feat(relays): generic HTTP relay board, and point band switching at it
An operator was about to build band→relay mapping into the custom URL rows.
It already exists, and better: relay auto-control has a per-relay "band" rule
driving webswitch, KMTronic, Dingtian, Denkovi and USB boards. It holds state
so a relay is only commanded when its wanted position changed, reads the
boards live before the first apply so it does not re-command one already in
place, and carries per-relay labels. A URL fired on a band change has none of
that, and would have been a second definition of "which antenna on which band"
— the drift that cost us a week on counties.
So the gap was only the hardware: a hand-made switch is none of the five named
types. It is now the sixth, "HTTP relay": an ON URL and an OFF URL, either as
one pattern with {relay} substituted, or one pair per relay. The per-relay
form is the reason it exists — these boxes often have URLs with nothing in
common between channels (…/FF0101 and …/FF0201), which no pattern can express.
Status is remembered rather than read: most have no endpoint worth trusting.
The cost is stated in the code and the panel — after a restart every relay is
re-commanded once, which is harmless on a board with no memory and far better
than assuming an antenna is already selected.
And the Connections panel now says so, exactly where the wrong choice is made:
picking a band change with a URL transport shows a note pointing at Station
Control. The URL transport stays — a lookup pushed to a webhook or a QSO to a
dashboard is an event, not a state, and Station Control has no place for it.
This commit is contained in:
@@ -501,6 +501,17 @@ function CustomFields({ draft, setDraft }: {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* The one place these two features overlap. A relay board is a STATE per
|
||||
band, not an event: Station Control tracks it, reads the boards at
|
||||
startup and does not re-switch while the VFO moves inside a band. A
|
||||
URL fired on a band change has none of that, and building the mapping
|
||||
by hand here is work that is already done there. */}
|
||||
{draft.trigger === 'band_change' && isURL && (
|
||||
<div className="rounded border border-warning-border bg-warning-muted px-2 py-1.5 text-[11px] text-warning-muted-foreground leading-relaxed">
|
||||
{t('udpp.relayInstead')}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isURL ? (
|
||||
<div className="space-y-1">
|
||||
<Label>{t('udpp.url')}</Label>
|
||||
|
||||
Reference in New Issue
Block a user