From 8a9c7a11476730fed986f394e407168666dcb3d2 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 26 Oct 2025 09:42:02 -0700 Subject: [PATCH] changes to dx spotter by is now of and xota is now ota --- modules/README.md | 114 ++++++++++++++++++++++---------------------- modules/dxspot.py | 4 +- modules/test_bot.py | 9 +++- 3 files changed, 67 insertions(+), 60 deletions(-) diff --git a/modules/README.md b/modules/README.md index 3adb4fb..7b1cee7 100644 --- a/modules/README.md +++ b/modules/README.md @@ -267,6 +267,64 @@ Configure in `[wikipedia]` section of `config.ini`. --- + +# DX Spotter Module + +The DX Spotter module allows you to fetch and display recent DX cluster spots from [spothole.app](https://spothole.app) directly in your mesh-bot. + +## Command + +| Command | Description | +|---------|------------------------------| +| `dx` | Show recent DX cluster spots | + +## Usage + +Send a message to the bot containing the `dx` command. You can add filters to narrow down the results: + +- **Basic usage:** + ``` + dx + ``` + Returns the latest DX spots. + +- **With filters:** + ``` + dx band=20m mode=SSB + dx xota=WWFF + dx by=K7MHI + ``` + - `band=`: Filter by band (e.g., 20m, 40m) + - `mode=`: Filter by mode (e.g., SSB, CW, FT8) + - `ota=`: Filter by source/group (e.g., WWFF, POTA, SOTA) + - `of=`: Filter by callsign of the spotted DX + +## Example Output + +``` +K7ABC @14.074 MHz FT8 WWFF KFF-1234 by:N0CALL CN87 Some comment +W1XYZ @7.030 MHz CW SOTA W7W/WE-001 by:K7MHI CN88 +``` + +- Each line shows: + `DX_CALL @FREQUENCY MODE GROUP GROUP_REF by:SPOTTER_CALL SPOTTER_GRID COMMENT` + +## Notes + +- Returns up to 4 of the most recent spots matching your filters. +- Data is fetched from [spothole.app](https://spothole.app/). +- If no spots are found, you’ll see: + `No DX spots found.` + +## Configuration + +No additional configuration is required. The module is enabled if present in your `modules/` directory. + +--- + +**Written for Meshtastic mesh-bot by K7MHI Kelly Keeton 2025** + + ## 📅 Mesh Bot Scheduler User Guide Automate messages and tasks using the scheduler module. @@ -874,62 +932,6 @@ bbslink_enabled = True bbslink_whitelist = # list of whitelisted nodes numbers ex: 2813308004,4258675309 empty list allows all ``` -# DX Spotter Module - -The DX Spotter module allows you to fetch and display recent DX cluster spots from [spothole.app](https://spothole.app) directly in your mesh-bot. - -## Command - -| Command | Description | -|---------|------------------------------| -| `dx` | Show recent DX cluster spots | - -## Usage - -Send a message to the bot containing the `dx` command. You can add filters to narrow down the results: - -- **Basic usage:** - ``` - dx - ``` - Returns the latest DX spots. - -- **With filters:** - ``` - dx band=20m mode=SSB - dx xota=WWFF - dx by=K7MHI - ``` - - `band=`: Filter by band (e.g., 20m, 40m) - - `mode=`: Filter by mode (e.g., SSB, CW, FT8) - - `xota=`: Filter by source/group (e.g., WWFF, POTA, SOTA) - - `by=`: Filter by callsign of the spotter - -## Example Output - -``` -K7ABC @14.074 MHz FT8 WWFF KFF-1234 by:N0CALL CN87 Some comment -W1XYZ @7.030 MHz CW SOTA W7W/WE-001 by:K7MHI CN88 -``` - -- Each line shows: - `DX_CALL @FREQUENCY MODE GROUP GROUP_REF by:SPOTTER_CALL SPOTTER_GRID COMMENT` - -## Notes - -- Returns up to 4 of the most recent spots matching your filters. -- Data is fetched from [spothole.app](https://spothole.app/). -- If no spots are found, you’ll see: - `No DX spots found.` - -## Configuration - -No additional configuration is required. The module is enabled if present in your `modules/` directory. - ---- - -**Written for Meshtastic mesh-bot by K7MHI Kelly Keeton 2025** - Happy meshing! \ No newline at end of file diff --git a/modules/dxspot.py b/modules/dxspot.py index 5fb06cf..e4c58f8 100644 --- a/modules/dxspot.py +++ b/modules/dxspot.py @@ -21,9 +21,9 @@ def handledxcluster(message, nodeID, deviceID): band = part.split("=")[1] elif part.lower().startswith("mode="): mode = part.split("=")[1] - elif part.lower().startswith("xota="): + elif part.lower().startswith("ota="): source = part.split("=")[1] - elif part.lower().startswith("by="): + elif part.lower().startswith("of="): dx_call = part.split("=")[1] # Build params dict params = {} diff --git a/modules/test_bot.py b/modules/test_bot.py index 26e84c2..ae101dd 100644 --- a/modules/test_bot.py +++ b/modules/test_bot.py @@ -300,7 +300,6 @@ class TestBot(unittest.TestCase): self.assertIsInstance(end_msg, str) - def test_hamtest_answer_one(self): from games.hamtest import hamtest user_id = "testuser" @@ -314,12 +313,18 @@ class TestBot(unittest.TestCase): self.assertIsInstance(answer_msg, str) - ##### API Tests - Extended tests run only if CHECKALL is True ##### if CHECKALL: logger.info("Running extended API tests as CHECKALL is enabled.") + def test_handledxcluster(self): + from modules.dxspot import handledxcluster + test_message = "DX band=20m mode=SSB of=K7MHI" + response = handledxcluster(test_message, nodeID=0, deviceID='testdevice') + print("DX Spotter response:", response) + self.assertIsInstance(response, str) + def test_getRepeaterBook(self): from locationdata import getRepeaterBook repeaters = getRepeaterBook(lat, lon)