Skip to content

Add continue_job() to complete job lifecycle control#156

Merged
agners merged 1 commit into
home-assistant-libs:mainfrom
heikkih:feat/continue-job
Apr 28, 2026
Merged

Add continue_job() to complete job lifecycle control#156
agners merged 1 commit into
home-assistant-libs:mainfrom
heikkih:feat/continue-job

Conversation

@heikkih
Copy link
Copy Markdown
Contributor

@heikkih heikkih commented Apr 23, 2026

Summary

The PrusaLink API exposes four job-control endpoints, but only three were implemented:

Method Endpoint Status
cancel_job() DELETE /api/v1/job/{id} ✅ existing
pause_job() PUT /api/v1/job/{id}/pause ✅ existing
resume_job() PUT /api/v1/job/{id}/resume ✅ existing
continue_job() PUT /api/v1/job/{id}/continue ➕ this PR

continue_job() is needed to resume printing after a timelapse snapshot is captured. Without it, a timelapse-enabled print job cannot be unblocked programmatically.

This is the third PR in a series of improvements to pyprusalink and the Home Assistant prusalink integration (#154, #155).

Changes

  • pyprusalink/__init__.py: adds continue_job(jobId: int) -> None
  • tests/test_prusalink.py: adds test_continue_job

Test plan

  • pytest tests/ -v — 16 passed
  • flake8 pyprusalink tests — no errors
  • black --check pyprusalink tests — no reformats needed
  • isort --check pyprusalink tests — no changes needed

🤖 Generated with Claude Code

@heikkih heikkih force-pushed the feat/continue-job branch 2 times, most recently from e76ef56 to 9c6e54e Compare April 27, 2026 15:15
The API supports pausing, resuming, cancelling and continuing jobs
(the latter after a timelapse capture), but only the first three were
exposed. Adds the missing continue_job(jobId) method.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@heikkih heikkih force-pushed the feat/continue-job branch from 9c6e54e to 87508b1 Compare April 28, 2026 11:47
Copy link
Copy Markdown
Contributor

@agners agners left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Comment thread pyprusalink/__init__.py
pass

async def continue_job(self, jobId: int) -> None:
"""Continue a job after a timelapse capture."""
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd guess this also works for M600 (color change) etc? Either way, this wording is also used in OpenAPI, so I am fine with it.

@agners agners merged commit c2d2f12 into home-assistant-libs:main Apr 28, 2026
2 checks passed
@heikkih heikkih deleted the feat/continue-job branch April 28, 2026 17:42
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