Skip to content

refactor: drop dead API surface and hoist record-type sets to module level - #70

Merged
roquerodrigo merged 1 commit into
mainfrom
refactor/cleanup
Aug 7, 2026
Merged

refactor: drop dead API surface and hoist record-type sets to module level#70
roquerodrigo merged 1 commit into
mainfrom
refactor/cleanup

Conversation

@roquerodrigo

Copy link
Copy Markdown
Owner

Summary

Three small internal cleanups, no behavior change:

  • Dead code: TtlockBleApiClient.credentials had no production caller — its only consumer was a test asserting the passthrough. Property and test removed.
  • Allocation churn: _classify_record rebuilt four sets of LogOperate members on every log entry. They now live as module-level frozenset constants next to PASSCODE_RECORD_TYPES, which already followed that pattern.
  • Import consistency: data/runtime.py was the only module importing its own package via the absolute custom_components.ttlock_ble. path. It now uses parent-relative imports (..connection, ..coordinator), with TID252 added to the ruff ignore list to match the repo's documented relative-import convention.

Verification

Full lint + mypy + test suite green (261 passed, coverage 100%).

…level

TtlockBleApiClient.credentials had no production caller; its only use
was a test asserting the passthrough, so both go.

_classify_record rebuilt four sets on every log entry; they are now
module-level frozensets alongside PASSCODE_RECORD_TYPES.

data/runtime.py was the one module importing its own package by
absolute path; it now uses parent-relative imports, with TID252
ignored to match the repo's relative-import convention.
@roquerodrigo
roquerodrigo merged commit c430338 into main Aug 7, 2026
10 checks passed
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