Pymavlink mavftp#1684
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens up the MAVLink FTP backend implementation by adding type annotations, improving None-safety around FTP payload handling, and removing the Ruff per-file ignore for backend_mavftp.py so the file is linted consistently with the rest of the project.
Changes:
- Added/expanded type annotations across MAVFTP-related classes and methods (callbacks, args, internal helpers).
- Hardened several code paths against
Nonepayloads and ensured numeric settings are coerced tointwhere required. - Removed the Ruff per-file ignore for
ardupilot_methodic_configurator/backend_mavftp.pyand added targeted# noqaannotations in-code instead.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
pyproject.toml |
Removes Ruff per-file ignores for backend_mavftp.py, making it subject to standard linting rules. |
ardupilot_methodic_configurator/backend_mavftp.py |
Adds typing and None-safety improvements throughout the MAVFTP implementation and CLI helpers. |
Comments suppressed due to low confidence (1)
ardupilot_methodic_configurator/backend_mavftp.py:1682
- The heartbeat log message prints the system ID twice; the second placeholder is labeled "component" but uses
m.target_systemagain. This makes the log misleading and can complicate debugging multi-component systems.
def wait_heartbeat(m: "MavlinkConnection") -> None:
"""Wait for a heartbeat so we know the target system IDs."""
logging.info("Waiting for flight controller heartbeat")
m.wait_heartbeat(timeout=5)
logging.info("Heartbeat from system %u, component %u", m.target_system, m.target_system)
| """Save Ardupilot parameter information to a local file.""" | ||
| if not pdict: | ||
| if not pdict or not filename: | ||
| return | ||
| with open(filename, "w", encoding="utf-8") as f: |
☂️ Code Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
Test Results 4 files ±0 4 suites ±0 44m 4s ⏱️ +8s For more details on these errors, see this check. Results for commit be0f919. ± Comparison against base commit c893c4a. ♻️ This comment has been updated with latest results. |
21f0568 to
fa5da81
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
ardupilot_methodic_configurator/backend_mavftp.py:1682
- The heartbeat log message prints
m.target_systemfor both the system and component fields, so the component ID is never shown correctly.
def wait_heartbeat(m: "MavlinkConnection") -> None:
"""Wait for a heartbeat so we know the target system IDs."""
logging.info("Waiting for flight controller heartbeat")
m.wait_heartbeat(timeout=5)
logging.info("Heartbeat from system %u, component %u", m.target_system, m.target_system)
fa5da81 to
be0f919
Compare
Description
Describe what this PR is trying to achieve. Please read our Contributing Guide for detailed guidelines.
Checklist
git commit --signoff)Testing
Describe how you tested these changes: