Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pyprusalink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ async def resume_job(self, jobId: int) -> None:
async with self.client.request("PUT", f"/api/v1/job/{jobId}/resume"):
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.

async with self.client.request("PUT", f"/api/v1/job/{jobId}/continue"):
pass

async def get_version(self) -> VersionInfo:
"""Get the version."""
async with self.client.request("GET", "/api/version") as response:
Expand Down
7 changes: 7 additions & 0 deletions tests/test_prusalink.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ async def test_resume_job(pl, respx_mock):
await pl.resume_job(42)


async def test_continue_job(pl, respx_mock):
respx_mock.put(f"{HOST}/api/v1/job/42/continue").mock(
return_value=httpx.Response(204)
)
await pl.continue_job(42)


async def test_get_file(pl, respx_mock):
thumbnail_bytes = b"\x89PNG\r\nfake-image-data"
respx_mock.get(f"{HOST}/api/thumbnails/test.png").mock(
Expand Down