feat(wavelog): push station frequency/mode to Wavelog per operator
Add a CAT integration so the station's current frequency and mode are
reported to each operator's personal Wavelog logbook via Wavelog's radio
API (POST <baseUrl>/index.php/api/radio).
- New plugin rms.wavelog.cat (capability logging.cat.publish): posts
{key, radio, frequency, mode}. Base URL / radio name come from plugin
settings or env (WAVELOG_BASE_URL, WAVELOG_RADIO_NAME); no secrets in repo.
- Core hook in the OpenWebRX band-select flow pushes centerFreqHz + startMod
for the active operator, best-effort (never breaks the band change).
- Per-user Wavelog API key stored on the user record; PUT /v1/me/wavelog-key
to set it, returned by GET /v1/me and the OpenWebRX session issue response.
- UI: Wavelog API key field in the OpenWebRX panel (visible when generating
the session link), with i18n (de/en).
- Docs, .env.example entries, and a unit test for the mode mapping.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
29
test/wavelog-cat.test.js
Normal file
29
test/wavelog-cat.test.js
Normal file
@@ -0,0 +1,29 @@
|
||||
const test = require("node:test");
|
||||
const assert = require("node:assert");
|
||||
|
||||
const { toAdifMode } = require("../plugins/rms.wavelog.cat/index.js");
|
||||
|
||||
test("toAdifMode maps phone submodes to SSB", () => {
|
||||
assert.strictEqual(toAdifMode("usb"), "SSB");
|
||||
assert.strictEqual(toAdifMode("LSB"), "SSB");
|
||||
assert.strictEqual(toAdifMode("ssb"), "SSB");
|
||||
});
|
||||
|
||||
test("toAdifMode maps cw/fm/am variants", () => {
|
||||
assert.strictEqual(toAdifMode("cw"), "CW");
|
||||
assert.strictEqual(toAdifMode("cwr"), "CW");
|
||||
assert.strictEqual(toAdifMode("nfm"), "FM");
|
||||
assert.strictEqual(toAdifMode("fm"), "FM");
|
||||
assert.strictEqual(toAdifMode("am"), "AM");
|
||||
});
|
||||
|
||||
test("toAdifMode passes unknown modes through in upper case", () => {
|
||||
assert.strictEqual(toAdifMode("ft8"), "FT8");
|
||||
assert.strictEqual(toAdifMode("c4fm"), "C4FM");
|
||||
});
|
||||
|
||||
test("toAdifMode returns empty string for empty input", () => {
|
||||
assert.strictEqual(toAdifMode(""), "");
|
||||
assert.strictEqual(toAdifMode(null), "");
|
||||
assert.strictEqual(toAdifMode(undefined), "");
|
||||
});
|
||||
Reference in New Issue
Block a user