Skip to content

feat: enforce SUPPORTS_* capability flags - #25

Merged
nbuchwitz merged 1 commit into
mainfrom
feat/enforce-capability-flags
Jun 13, 2026
Merged

nbuchwitz merged 1 commit into
mainfrom
feat/enforce-capability-flags

Conversation

@nbuchwitz

Copy link
Copy Markdown
Owner

The SUPPORTS_* flags were declarative-only: nothing read them (except SUPPORTS_PAGE_NUMBER_CUTS), so a model declaring SUPPORTS_HALF_CUT=False (e.g. PT-P710BT) would still emit the feature.

Add LabelPrinter._resolve_feature() and route print()'s auto_cut, half_cut, mirror, chain and special_tape through it:

  • Explicitly requesting an unsupported feature now raises ValueError.
  • An unsupported feature is never enabled by its DEFAULT_* (clamped off).

print_multi() clamps its bool half_cut default to the printer's capability so the common path falls back to full cuts instead of raising. The CLI likewise only half-cuts when the model supports it, which also fixes the PT-P710BT case where multi-label jobs previously sent a half-cut the firmware ignores (no cut between labels).

Adds tests covering the raise, the default clamp, explicit-false on an unsupported feature, and the print_multi/P710BT clamp.

The SUPPORTS_* flags were declarative-only: nothing read them (except
SUPPORTS_PAGE_NUMBER_CUTS), so a model declaring SUPPORTS_HALF_CUT=False
(e.g. PT-P710BT) would still emit the feature.

Add LabelPrinter._resolve_feature() and route print()'s auto_cut,
half_cut, mirror, chain and special_tape through it:
- Explicitly requesting an unsupported feature now raises ValueError.
- An unsupported feature is never enabled by its DEFAULT_* (clamped off).

print_multi() clamps its bool half_cut default to the printer's
capability so the common path falls back to full cuts instead of
raising. The CLI likewise only half-cuts when the model supports it,
which also fixes the PT-P710BT case where multi-label jobs previously
sent a half-cut the firmware ignores (no cut between labels).

Adds tests covering the raise, the default clamp, explicit-false on an
unsupported feature, and the print_multi/P710BT clamp.
@nbuchwitz nbuchwitz self-assigned this Jun 13, 2026
@nbuchwitz
nbuchwitz merged commit 67a5bd4 into main Jun 13, 2026
3 checks passed
@nbuchwitz
nbuchwitz deleted the feat/enforce-capability-flags branch June 13, 2026 19:02
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.

1 participant