Skip to content

feat(discovery): surface corrupt modules as a Repairs message (reprogram)#460

Merged
fdebrus merged 1 commit into
mainfrom
claude/corrupt-module-repair
Jun 10, 2026
Merged

feat(discovery): surface corrupt modules as a Repairs message (reprogram)#460
fdebrus merged 1 commit into
mainfrom
claude/corrupt-module-repair

Conversation

@fdebrus

@fdebrus fdebrus commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

Companion to nikobus-connect #121 (which I pivoted per your call: detect a corrupt module link table and skip it — no re-alignment, no phantom buttons). This is the HA side: the user-facing message.

When the library flags a module's link table as corrupt (misaligned with the scanned register window — decode skipped), the integration now surfaces it as a Repairs issue instead of silently dropping those links:

  • _surface_corrupt_modules() reads nikobus_discovery.corrupt_link_tables after a module scan and creates/clears a Repairs issue listing the affected modules.
  • is_fixable=False — the cure is reprogramming in the Nikobus PC software, nothing HA can do — so it's an informational warning with clear guidance (en/fr/nl), no fix flow. Also logged at WARNING.
  • Auto-clears on the next module scan once the module reads cleanly; gated to module scans (not a pure PC-Link inventory) so an inventory-only run can't clear a still-valid warning.

The message (en): "N Nikobus module(s) reported a corrupt link table and were skipped… This is a module-side issue — the Nikobus PC software reports the same and asks for reprogramming. Reprogram the listed module(s), then run Load Existing Installation again."

Policy

Per your decision: detect → tell the user → wait for reprogramming. We do not try to find buttons on a corrupt module. This matches exactly what your 4707 case proved — reprogramming was the real and complete cure.

Verification

449 passed (+3: creates informational issue with sorted module list; clears when none; tolerates an older library without the attribute), ruff clean, mypy 101 (baseline 100; the +1 is the same documented NikobusConfigEntry-alias entry_id artifact as the sibling _surface_legacy_undecoded_buttons, not a new issue).

Gating

Needs nikobus-connect 0.27.2 (the corrupt_link_tables attribute). The HA pin is already >=0.27.0, and the code uses getattr(..., None) so it degrades gracefully on 0.27.0/0.27.1 (no flag → no issue). Merge order: publish lib 0.27.2 (#121) → this is safe to merge anytime.

https://claude.ai/code/session_01LH7yGDY8ttvZUVMVjfSNXj


Generated by Claude Code

…ram)

Companion to nikobus-connect 0.27.2 (corrupt link-table detection). When
the library flags a module's link table as corrupt (misaligned with the
scanned register window — decode skipped, no phantom buttons), the
integration now tells the USER about it instead of silently dropping
those links.

- _surface_corrupt_modules() reads nikobus_discovery.corrupt_link_tables
  after a module scan (register decode) and creates/clears a Repairs
  issue listing the affected modules. is_fixable=False — the cure is
  reprogramming in the Nikobus PC software, nothing HA can do — so it's
  an informational warning with clear guidance, no fix flow. Auto-clears
  on the next module scan once the module reads cleanly. Gated to module
  scans (not pure PC-Link inventory) so an inventory-only run can't clear
  a still-valid warning. Also logged at WARNING.
- ISSUE_CORRUPT_MODULES constant; en/fr/nl issue translations.

Policy (per maintainer): we do NOT try to recover buttons from a corrupt
module — detect, warn the user, wait for reprogramming.

Tests: +3 (creates informational issue with sorted module list; clears
when none; tolerates an older library without the attribute). 449
passed, ruff clean, mypy 101 (baseline 100; the +1 is the same
documented NikobusConfigEntry-alias 'entry_id' artifact as the sibling
_surface_legacy_undecoded_buttons, not a new issue).

https://claude.ai/code/session_01LH7yGDY8ttvZUVMVjfSNXj
@fdebrus fdebrus merged commit 43910f2 into main Jun 10, 2026
8 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.

2 participants