Skip to content

v0.1.9 - Threshold Configuration Command (2025-12-02)

What Changed?

This release adds a new threshold command to the CLI for configuring device threshold values. The command accepts threshold values in a simple string format and converts them to a dictionary format for device communication. The implementation includes proper error handling and helper functions for parsing threshold inputs.


What's New

Main Feature: Threshold Command

What it does: The new threshold command allows users to set detection threshold values on the device. It parses a simple string format (e.g., "1:300;2:330;3:350") into a dictionary and sends it to the device.

How to use it:

kazunoko threshold "1:300;2:330;3:350"
kazunoko threshold "1:300;2:330;3:350" --port /dev/ttyUSB0 -v
kazunoko threshold "1:300;2:330;3:350" --mock

Code example:

# String format is parsed to dictionary
"1:300;2:330;3:350" -> {1: 300, 2: 330, 3: 350}

# Sent to device with Command wrapper
cmd = Command(device)
responses = cmd.thresholds({1: 300, 2: 330, 3: 350})

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

  • New threshold command for setting device threshold values
  • _parse_thresholds() helper function for parsing threshold strings
  • Comprehensive error handling for invalid threshold formats
  • Support for flexible threshold input (e.g., "1:300;2:330;3:350")

🔧 Changed

  • CLI now uses Command class wrapper in the info command for consistency

🐛 Fixed

  • Input validation for threshold format with clear error messages

Is It Safe to Upgrade?

Backward Compatible: Yes

  • No breaking changes to existing commands
  • New threshold command is additive only
  • All existing functionality remains unchanged

Tests Passed

  • ✅ Builds without errors
  • ✅ Linting (ruff check)
  • ✅ Type checking (mypy)
  • ✅ Threshold command with valid format
  • ✅ Error handling with invalid format

Release Details

  • Date: 2025-12-02
  • Version: v0.1.9
  • Files Changed: 1 (src/kazunoko/cli.py)
  • Commits:
  • 457cddd - refactor(cli): use Command class in info command
  • 1ce7f08 - feat(cli): add threshold command for setting device thresholds
  • c5199f1 - refactor(cli): convert threshold string to dict format
  • 49522f2 - refactor(cli): extract threshold parsing to _parse_thresholds helper
  • d0cade1 - refactor(cli): complete error handling for threshold parsing

Next Steps

Consider adding:

  • Unit tests for _parse_thresholds() function
  • Additional threshold validation (value range checks)
  • Interactive threshold configuration mode