You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Updated the response parser to support additional delimiters (`;` and `=`) for better command matching.
- Implemented strict prefix matching to prevent incorrect command matches.
- Introduced a new logging mechanism to clean payloads by removing preambles before logging.
- Added functionality to skip publishing messages with empty or invalid data.
- Ensured JSON output for MQTT messages is compact to maintain compatibility with brokers.
- Added tests to verify the new parsing logic and ensure robustness against invalid payloads.
- Refactored MQTT publisher to handle raw lines and improved error handling for empty payloads.
Copy file name to clipboardExpand all lines: docs/architecture/decisions/ADR-004-mqtt-response-parsing.adoc
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,11 @@ Dies stellt sicher, dass alle erfolgreichen `GET` Anfragen über MQTT eine struk
24
24
25
25
=== Detaillierte Logik-Anpassungen
26
26
27
-
1. **`get_config` (CG):**
27
+
1. **Erweitertes Parsing (Update 2026-01-13):**
28
+
* Der Response-Parser unterstützt nun `;` und `=` als Trennzeichen zusätzlich zu Leerzeichen (z.B. für `SR;R=...`).
29
+
* Es wird ein striktes Prefix-Matching erzwungen, um zu verhindern, dass Befehls-Prefixe längere Nachrichtentypen matchen (z.B. darf Befehl `M` nicht `MN;...` matchen).
30
+
31
+
2. **`get_config` (CG):**
28
32
* Wird eine private Hilfsfunktion `_parse_decoder_config(response: str) -> Dict[str, int]` in [`signalduino/commands.py`](signalduino/commands.py) implementiert.
29
33
* Diese Funktion parst den `key=value;` String in ein Dictionary (z.B. `{'MS': 1, 'MU': 1, 'MC': 1, 'Mred': 1}`).
30
34
* Der Rückgabetyp von `get_config` wird von `str` auf `Dict[str, int]` geändert.
Copy file name to clipboardExpand all lines: docs/architecture/decisions/ADR-006-json-output-schema.adoc
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,9 @@ Wir werden das JSON-Output-Schema von `DecodedMessage` wie folgt anpassen:
17
17
18
18
Die Umbenennung des Nutzdatenfeldes von `payload` zu `data` sowie die Einführung des Feldes `raw` (für die ursprüngliche Nachricht) sind in link:ADR-007-data-and-raw-fields.adoc[ADR-007] dokumentiert, das dieses Schema ergänzt und präzisiert. Dieses ADR dient als Grundlage für die Einführung des `protocol`-Feldes und die Bereinigung des Nutzdateninhalts.
19
19
20
+
=== Serialisierungsformat
21
+
Der JSON-Output für MQTT-Nutzdaten muss **kompakt** (ohne Zeilenumbrüche und Einrückungen) serialisiert werden, um die Kompatibilität mit MQTT-Brokern und Downstream-Systemen zu gewährleisten, die multiline-Nutzdaten falsch interpretieren könnten. Dies wird durch das Weglassen des `indent`-Parameters beim `json.dumps`-Aufruf in `MqttPublisher` sichergestellt.
22
+
20
23
=== Details zur neuen Struktur (Präzisiert durch ADR-007)
0 commit comments