Skip to content

v0.1.46 - Add low-level query method to Command class (2025-12-14)

What Changed?

This release adds a query() method to the Command class for low-level device access. Users can now send arbitrary command strings directly through the Command interface without needing to access the underlying DeviceProtocol directly. The feature maintains full backward compatibility with all existing command methods.


What's New

Low-Level Query Method: Command.query()

What it does: Provides direct access to arbitrary device commands through the Command class without exposing the underlying DeviceProtocol. This enables flexibility for custom commands, experimental features, and future device functionality.

How to use it: Use Command.query(command_string) just like you would use DeviceProtocol.query(), but through the more convenient Command interface.

Code example:

from kazunoko import connect, Command

with connect() as device:
    cmd = Command(device)

    # Use convenience methods (unchanged)
    resp = cmd.status()

    # Or use raw query for custom commands (new)
    resp = cmd.query("GET_STATUS")
    resp = cmd.query("SET_THRESHOLD 1 300")
    resp = cmd.query("CUSTOM_CMD arg1 arg2")

Installation

Quick Start

# Get the release
git checkout vX.Y.Z

# Setup
task env:setup

# Run CLI
uv run kazunoko --help

What's Different from the Last Version?

✅ Added

  • Command.query(command: str) method for low-level device command access
  • Comprehensive docstring with examples and exception documentation

🔧 Changed

  • None (fully backward compatible)

🐛 Fixed

  • None

Is It Safe to Upgrade?

Backward Compatible: Yes

  • Existing code using convenience methods (status(), threshold(), etc.) continues to work without any changes
  • The new query() method is purely additive and optional

Tests Passed

  • ✅ Builds without errors
  • ✅ Code follows project conventions
  • ✅ Commitizen validation passed

Release Details

  • Date: 2025-12-14
  • Version: v0.1.46
  • Files Changed: 2 (command.py, v0.1.46.md)
  • Commits: 5a90837

Next Steps

The next focus areas may include: - Enhanced command validation and auto-completion - Additional convenience methods for common device configurations - Extended integration test coverage