Skip to content

Add page counter support#715

Open
brianegge wants to merge 2 commits intoctalkington:masterfrom
brianegge:add-page-counters
Open

Add page counter support#715
brianegge wants to merge 2 commits intoctalkington:masterfrom
brianegge:add-page-counters

Conversation

@brianegge
Copy link

Summary

  • Add Counters dataclass exposing printer-impressions-completed, printer-pages-completed, and printer-media-sheets-completed IPP attributes
  • Counters are requested by default and available via printer.counters on the Printer model
  • Values default to -1 when the printer doesn't report them (consistent with marker level conventions)

Test plan

  • All existing model tests pass
  • New tests for Counters.from_dict() with data and with missing data
  • New tests for Printer.counters integration and as_dict() serialization

🤖 Generated with Claude Code

brianegge and others added 2 commits March 14, 2026 16:27
Add a Counters dataclass that exposes printer-impressions-completed,
printer-pages-completed, and printer-media-sheets-completed IPP
attributes. These counters are requested by default and available
via printer.counters on the Printer model.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HP printers report impressions via a collection attribute
(printer-impressions-completed-col) with monochrome/full-color
breakdown instead of the scalar printer-impressions-completed.
When the scalar is absent, sum the collection values as a fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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