Summary
Deferred follow-up from #95 (comprehensive repo evaluation, batch 6: architecture cleanup).
src/nwp500/mqtt/client.py is currently 1572 lines. It already delegates to several focused helper modules (mqtt/connection.py, mqtt/subscriptions.py, mqtt/control.py, mqtt/reconnection.py, mqtt/periodic.py, mqtt/command_queue.py, mqtt/state_tracker.py, mqtt/diagnostics.py), but NavienMqttClient itself has grown to carry a large amount of orchestration and convenience-method logic directly rather than acting as a thin façade.
Suggested approach
- Audit
client.py for logic that duplicates or could be pushed down into an existing helper module (e.g. connection lifecycle glue, event wiring, convenience wrappers around subscription/control methods).
- Extract cohesive chunks into new or existing helper modules, leaving
NavienMqttClient as a coordinator that wires helpers together and exposes the public API surface.
- Keep the public API (methods/signatures on
NavienMqttClient) stable unless a breaking change is explicitly justified and documented in CHANGELOG.rst per the project's no-backward-compat policy.
Acceptance criteria
mqtt/client.py meaningfully reduced in size (target: comparable to other helper modules, roughly a few hundred lines of coordination logic).
- No behavior change; existing tests continue to pass.
ruff/mypy clean.
Summary
Deferred follow-up from #95 (comprehensive repo evaluation, batch 6: architecture cleanup).
src/nwp500/mqtt/client.pyis currently 1572 lines. It already delegates to several focused helper modules (mqtt/connection.py,mqtt/subscriptions.py,mqtt/control.py,mqtt/reconnection.py,mqtt/periodic.py,mqtt/command_queue.py,mqtt/state_tracker.py,mqtt/diagnostics.py), butNavienMqttClientitself has grown to carry a large amount of orchestration and convenience-method logic directly rather than acting as a thin façade.Suggested approach
client.pyfor logic that duplicates or could be pushed down into an existing helper module (e.g. connection lifecycle glue, event wiring, convenience wrappers around subscription/control methods).NavienMqttClientas a coordinator that wires helpers together and exposes the public API surface.NavienMqttClient) stable unless a breaking change is explicitly justified and documented inCHANGELOG.rstper the project's no-backward-compat policy.Acceptance criteria
mqtt/client.pymeaningfully reduced in size (target: comparable to other helper modules, roughly a few hundred lines of coordination logic).ruff/mypyclean.