Log per-write and per-command traces at DEBUG, release 0.2.1 #5

Merged
tim merged 1 commit from fix/quiet-info-logging into main 2026-10-12 19:33:33 +00:00
Owner

Home Assistant runs at INFO by default and one poll writes dozens of frames. A connected car produced 3-5k library log lines per hour (about 1.1k per hour even while the car was asleep, from the retry attempts) and tripped HA's "logging too frequently" warning.

Changes

Per-write, per-command and per-connection traces go from INFO to DEBUG:

  • bleserial: "Writing data to characteristic ...", "BleakClient disconnected (expected)"
  • obd: "Sending command", "Closing connection", "Vehicle not responding"
  • elm327: "Initializing ELM327", "closing port"

Unchanged: setup failures ("Set Header ... did not return"), "No valid OBD Messages returned", warnings and errors.

Version bumped to 0.2.1; the auto-tag workflow tags it on merge.

Tests

  • New tests/test_logging_levels.py: write, query (unresponsive vehicle) and close paths emit nothing at INFO, and still trace at DEBUG.
  • Fails on the old code (3 of 5), passes on the new. Full suite: 188 passed. ruff check and format clean.
  • Not covered: the "Initializing ELM327" and expected-disconnect lines (inside connection setup); same one-word change.
Home Assistant runs at INFO by default and one poll writes dozens of frames. A connected car produced 3-5k library log lines per hour (about 1.1k per hour even while the car was asleep, from the retry attempts) and tripped HA's "logging too frequently" warning. ## Changes Per-write, per-command and per-connection traces go from INFO to DEBUG: - `bleserial`: "Writing data to characteristic ...", "BleakClient disconnected (expected)" - `obd`: "Sending command", "Closing connection", "Vehicle not responding" - `elm327`: "Initializing ELM327", "closing port" Unchanged: setup failures ("Set Header ... did not return"), "No valid OBD Messages returned", warnings and errors. Version bumped to 0.2.1; the auto-tag workflow tags it on merge. ## Tests - New `tests/test_logging_levels.py`: write, query (unresponsive vehicle) and close paths emit nothing at INFO, and still trace at DEBUG. - Fails on the old code (3 of 5), passes on the new. Full suite: 188 passed. ruff check and format clean. - Not covered: the "Initializing ELM327" and expected-disconnect lines (inside connection setup); same one-word change.
Log per-write and per-command traces at DEBUG, release 0.2.1
All checks were successful
Security / Security scan (pull_request) Successful in 34s
Test / Lint and test (pull_request) Successful in 17s
9aee53a6a9
Home Assistant runs at INFO by default and one poll writes dozens of
frames, so a connected car produced 3-5k log lines per hour (about 1.1k
per hour even while the car was asleep, from the retry attempts), and
tripped HA's "logging too frequently" warning.

Downgrade the per-write, per-command and per-connection traces to DEBUG:
bleserial write and expected-disconnect, obd command send, close and
"vehicle not responding", elm327 init and port close. Setup failures and
"no valid messages" stay at INFO, and warnings/errors are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tim merged commit d2af4ffa70 into main 2026-10-12 19:33:33 +00:00
tim deleted branch fix/quiet-info-logging 2026-10-12 19:33:33 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tim/py-nissan-leaf-obd-ble!5
No description provided.