Skip to content

Conversation

@sidey79
Copy link
Collaborator

@sidey79 sidey79 commented Dec 31, 2025

No description provided.

sidey79 and others added 17 commits December 21, 2025 21:15
STX messages (sensor data) can be interleaved with command responses, similar to MU/MS messages.
The controller must skip these messages and continue waiting for the actual command response.
The STX message is parsed to ensure sensor data is handled correctly while waiting.
- Fix busy loop in `mock_transport` fixture by adding `asyncio.sleep` to `readline` side effect.
- Fix `test_initialize_retry_logic` assertion to account for 'XQ' command sent during initialization.
- Fix `test_stx_message_bypasses_command_response` by manually starting controller tasks and updating mock response.
- Fix `test_send_command_with_response` by starting the missing `_parser_task`, updating mock to avoid StopIteration, and increasing timeout.
- Fix `test_message_callback` mock setup to yield message once and then None.
- Fix `test_send_command_fire_and_forget` cleanup logic to remove undefined `reader_task` cancellation.
This commit introduces new functionality to process Signalduino commands received via MQTT, significantly enhancing the integration capabilities of PySignalduino.

Key changes include:
- Extended the command list in `signalduino/commands.py` to include new MQTT-related commands and specific CC1101 register commands.
- Implemented and integrated the MQTT publisher logic within `signalduino/controller.py`.
- Introduced and adapted unit tests in `tests/test_mqtt_commands.py` and other test files to ensure full coverage of the new MQTT command processing.
@codecov
Copy link

codecov bot commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 80.72289% with 112 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.57%. Comparing base (57a12f0) to head (d8d8df3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
signalduino/controller.py 69.54% 48 Missing and 5 partials ⚠️
signalduino/commands.py 65.71% 35 Missing and 1 partial ⚠️
tests/conftest.py 76.92% 5 Missing and 1 partial ⚠️
tests/test_controller.py 94.04% 3 Missing and 2 partials ⚠️
tests/test_connection_drop.py 88.46% 3 Missing ⚠️
tests/test_mqtt.py 90.00% 3 Missing ⚠️
tests/test_mqtt_commands.py 88.88% 3 Missing ⚠️
tests/test_transport.py 88.88% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #8      +/-   ##
==========================================
+ Coverage   79.02%   80.57%   +1.55%     
==========================================
  Files          55       56       +1     
  Lines        5177     5014     -163     
  Branches      628      590      -38     
==========================================
- Hits         4091     4040      -51     
+ Misses        863      767      -96     
+ Partials      223      207      -16     
Flag Coverage Δ
unittests 80.57% <80.72%> (+1.55%) ⬆️

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.

Sign up for free to 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.

2 participants