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:
@@ -3273,6 +3273,10 @@ export namespace main {
|
||||
pass?: string;
|
||||
channels?: number;
|
||||
labels: string[];
|
||||
on_urls?: string[];
|
||||
off_urls?: string[];
|
||||
on_pattern?: string;
|
||||
off_pattern?: string;
|
||||
|
||||
static createFrom(source: any = {}) {
|
||||
return new StationDevice(source);
|
||||
@@ -3288,6 +3292,10 @@ export namespace main {
|
||||
this.pass = source["pass"];
|
||||
this.channels = source["channels"];
|
||||
this.labels = source["labels"];
|
||||
this.on_urls = source["on_urls"];
|
||||
this.off_urls = source["off_urls"];
|
||||
this.on_pattern = source["on_pattern"];
|
||||
this.off_pattern = source["off_pattern"];
|
||||
}
|
||||
}
|
||||
export class StationRelay {
|
||||
|
||||
Reference in New Issue
Block a user