Skip to content

POC: Implementiere MqttSignalduino_DispatchFromJSON - #14

Open
sidey79 wants to merge 6 commits into
mainfrom
poc/mqttFHEM
Open

POC: Implementiere MqttSignalduino_DispatchFromJSON#14
sidey79 wants to merge 6 commits into
mainfrom
poc/mqttFHEM

Conversation

@sidey79

@sidey79sidey79 commented Jan 9, 2026

Copy link
Copy Markdown
Collaborator

Beispielhafte Implementierung von MqttSignalduino_DispatchFromJSON um W125 Nachrichten in FHEM an das SD_WS Modul weiterleiten zu können:

Demo:
pysignalduino_fhem_poc1

@codecov

codecovBot commented Jan 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.84633% with 86 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.63%. Comparing base (f7a43fa) to head (94db914).
⚠️ Report is 1 commits behind head on main.

Files with missing linesPatch %Lines
signalduino/mqtt.py42.62%25 Missing and 10 partials ⚠️
tests/test_mqtt.py72.82%25 Missing ⚠️
signalduino/controller.py77.77%8 Missing and 2 partials ⚠️
tests/test_response_matching.py85.71%10 Missing ⚠️
tests/test_stx_etx_handling.py94.33%1 Missing and 2 partials ⚠️
signalduino/parser/mc.py80.00%1 Missing and 1 partial ⚠️
signalduino/types.py83.33%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #14 +/- ##
==========================================
- Coverage 80.77% 80.63% -0.15% 
==========================================
Files 57 60 +3 Lines 5546 5949 +403 Branches 603 630 +27 ==========================================
+ Hits 4480 4797 +317 - Misses 853 924 +71 - Partials 213 228 +15 
FlagCoverage Δ
unittests80.63% <80.84%> (-0.15%)⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sidey79

Copy link
Copy Markdown
CollaboratorAuthor

@elektron-bbs@HomeAutoUser

Ich hab die "einfache" FHEM Variante mal rudimentär (also dirty & quick) implementiert.
Es funktioniert, wie angenommen. Man muss matchlist und clientlist im mqtt2_device anpassen und dann im bekannten Format den Dispatch ausführen. Vermutlich könnte man es auch einem dummy Signalduino device unterjubeln :)

… von JSON-Nachrichten und aktualisiere die FHEM-Konfiguration
sidey79 added 2 commits January 13, 2026 21:56
- 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.
…chiebe Preamble und Modulationsfelder ins Protokollobjekt
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@sidey79