Rename jobId to job_id on job-control methods#170
Merged
agners merged 1 commit intoMay 12, 2026
Conversation
Brings the four job-control methods (cancel_job, pause_job, resume_job, continue_job) in line with PEP 8 and with cancel_transfer(transfer_id) which already uses snake_case. Breaking change for callers using keyword arguments (cancel_job(jobId=42)). Home Assistant calls these methods positionally via `lambda api: api.cancel_job` in the button entity descriptions, so no HA-side changes are needed. Targeted at the 3.0.0 release (see home-assistant-libs#167). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 12, 2026
agners
pushed a commit
that referenced
this pull request
May 12, 2026
* Rewrite README for the 3.0 release The old three-line README didn't say much beyond the package name. The new one covers what someone landing on the PyPI page actually needs: - positioning: thin async wrapper, primary consumer is HA - requirements and async-only / httpx caveat - quickstart with credential note - public API table by endpoint - exception hierarchy and example - type contract: NotRequired vs T | None, why we use cast() instead of pydantic/msgspec - semver policy (TypedDict shape changes = breaking) - development setup and the opt-in integration test invocation Some of what's described — mypy strict, the cast() pattern, get_job() returning None, get_transfer() returning None — is landing as part of 3.0.0 in #167/#169/#170, so this README is sized to match that state. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Reframe the README intro per agners' review - Drop the "intentionally a thin wrapper" framing. As agners pointed out, that codifies a present-state property rather than a design principle — the library shape should be whatever serves the HA integration best, and may evolve. - Replace with "API shape decisions are weighted toward serving the HA integration", and qualify the no-validation/no-retry note as a current state ("Today... but the shape may evolve"). - Fix "PrusaLink v2 API" — the API isn't versioned that way; replace with "PrusaLink HTTP API" and explicitly note the legacy paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
agners
pushed a commit
that referenced
this pull request
May 12, 2026
* Add Copilot code review instructions Captures the conventions Copilot's PR reviewer should follow when reviewing this repo: review-style rules at the top (avoid commenting on lint/formatting since CI already enforces it), public API conventions (TypedDicts + cast at JSON boundaries is intentional, NotRequired over T | None, T | None reserved for "no data" return paths), test layout (respx + optional integration marker), and semver expectations for TypedDict shape changes. Standalone — no generator script like home-assistant/core has; the file is small enough to maintain by hand. Some of the conventions described (mypy strict, cast() pattern, PrinterInfo NotRequired migration, get_job() -> JobInfo | None) are landing as part of the upcoming 3.0.0 release in #167 / #169 / #170. The file describes the end state; once 3.0.0 ships, everything in here will be true on main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Address review on Copilot instructions - Drop "PrusaLink v2 API" framing — agners pointed out that the endpoints aren't versioned that way and the library also covers a few legacy paths (/api/version, /api/printer). Replace with "PrusaLink HTTP API" and explicitly mention both endpoint families. - Drop the blanket "suggest fixes at the library level" rule. As agners noted, that's case-by-case rather than a general principle. - Drop "thin wrapper" framing in favour of "the shape is weighted toward what serves the HA integration best". - Add concrete examples of helpful vs unhelpful Copilot feedback so the rule list isn't just abstract dos/don'ts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the 3.0.0 release per agreement in #167. Submitting as its own PR for review clarity.
Why
The four job-control methods —
cancel_job,pause_job,resume_job,continue_job— still use camelCasejobId: int, whilecancel_transfer(transfer_id: int)(added more recently) already uses snake_case. Renaming brings them in line with PEP 8 and removes the cross-module inconsistency.Breaking change
Callers using keyword arguments (
cancel_job(jobId=42)) will break. Home Assistant calls these methods positionally vialambda api: api.cancel_jobin the button entity descriptions, so no HA-side changes are needed.Test plan
pytest tests/— 22 passed (existing positional-call tests cover the rename)jobIdreferences remain in the codebase