Skip to content

Add firmware update support#367

Merged
MTrab merged 6 commits intomasterfrom
feature/firmware-update-support
Mar 30, 2026
Merged

Add firmware update support#367
MTrab merged 6 commits intomasterfrom
feature/firmware-update-support

Conversation

@MTrab
Copy link
Copy Markdown
Owner

@MTrab MTrab commented Mar 29, 2026

Summary

Add firmware update support across the API layer, including firmware auto-upgrade toggling, firmware availability lookup, OTA trigger support, Markdown-friendly changelog output, and debug logging around OTA trigger attempts.

Changes

This branch adds set_firmware_auto_upgrade(...), get_firmware_upgrade_info(...), and start_firmware_upgrade(...) to WorxCloud. It also adds domain exceptions for OTA support and missing firmware availability, keeps cached mower and device firmware state aligned, and documents the new helpers in the README.

The firmware availability flow was live-verified against two accounts: one mower returning firmware upgrade metadata with a newer version available, and one mower returning no available firmware. The implementation now handles 404 from GET /api/v2/product-items/{serial}/firmware-upgrade as no currently available firmware metadata, which matches the observed live behavior. OTA trigger logging was also added to make queue attempts and no-update rejections visible in debug logs.

Firmware changelogs are now exposed both in their raw form and as a Markdown-friendly changelog_markdown variant. This keeps the original payload intact while making the release notes easier to render cleanly in Home Assistant and other downstream integrations.

Testing

  • ruff format pyworxcloud/__init__.py pyworxcloud/exceptions.py tests/test_api_lifecycle.py
  • ruff check pyworxcloud/__init__.py pyworxcloud/exceptions.py tests/test_api_lifecycle.py
  • ./.venv/bin/pytest -q tests/test_api_lifecycle.py -k 'firmware_upgrade or firmware_auto_upgrade or toggle_auto_schedule or set_lawn'
  • ./.venv/bin/pytest -q tests/test_api_lifecycle.py -k 'firmware_upgrade_info or firmware_upgrade or changelog_markdown'
  • Live read-only verification against two real accounts for firmware availability behavior
  • Live trigger verification against one account without an available update, confirming NoFirmwareAvailableError
  • Live verification against one account with an available update, confirming product.changelog and product.changelog_markdown

Notes

Proposed semver label for merge: minor.
The semver label has not been set yet and can be finalized when the PR is prepared for merge.

@MTrab MTrab added the minor Minor version bump label Mar 29, 2026
@MTrab MTrab merged commit 2f9132d into master Mar 30, 2026
4 checks passed
@MTrab MTrab deleted the feature/firmware-update-support branch March 30, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request minor Minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant