Skip to content

Report errors to Home Assistant - #47

Open
JanPetterMG wants to merge 4 commits into
mainfrom
feat/error-reporting
Open

Report errors to Home Assistant#47
JanPetterMG wants to merge 4 commits into
mainfrom
feat/error-reporting

Conversation

@JanPetterMG

Copy link
Copy Markdown
Contributor

Enhance error reporting by sending various communication errors, including desk initialization and UART errors, to Home Assistant for better diagnostics.

… any Console/LIN UART errors and node errors.
@JanPetterMG JanPetterMG added enhancement New feature or request avr esp labels Sep 8, 2026
@JanPetterMG JanPetterMG added this to the v1.0.0 milestone Sep 8, 2026
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8878c9ce-cd5b-4e23-b753-80cf3ccdbb6e

📥 Commits

Reviewing files that changed from the base of the PR and between d4cdbe2 and 1fd1ddc.

📒 Files selected for processing (1)
  • src/esp/DeskService.cpp

Summary by CodeRabbit

  • New Features

    • Added detailed communication and component error reporting to desk diagnostics.
    • Added an “Errors” diagnostic sensor for Home Assistant.
    • Diagnostic data now includes node status and communication errors.
  • Bug Fixes

    • Improved detection and reporting of serial communication errors.
    • Corrected node state and position updates during controller communication.
  • Documentation

    • Updated the Home Assistant diagnostics table to reflect the revised information.

Walkthrough

Changes

The AVR handlers now report UART and LIN errors through updated console states. The ESP firmware stores these errors, publishes them in an errors array, and exposes them through Home Assistant diagnostics. The clang tidy workflow uses a stricter failure threshold.

Communication error reporting

Layer / File(s) Summary
AVR error transport
include/avr/..., src/avr/...
AVR console states and LIN handling now transmit UART error flags. Encoder updates use combined node messages.
ESP error state and protocol handling
include/esp/..., src/esp/...
The ESP parser records communication errors. DeskService stores error flags, node state, and reset behavior.
Diagnostics exposure
src/esp/DeskService.cpp, src/esp/HomeAssistantHandler.cpp, README.md
The published state includes decoded errors. Home Assistant discovery and documentation define the Errors diagnostic.

Clang analysis threshold

Layer / File(s) Summary
Tidy failure threshold
.github/workflows/clang.yml
The tidy job fails when more than one check fails.

Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to d4cdb

Firmware updates can report incorrect desk states and diagnostics can remain stale or mislabel UART failures. These communication-reporting regressions should be corrected before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 10 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: reporting communication errors to Home Assistant.
Description check ✅ Passed The description accurately describes sending desk initialization and UART errors to Home Assistant for improved diagnostics.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 10 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/error-reporting

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JanPetterMG
JanPetterMG marked this pull request as ready for review September 8, 2026 22:35
Copilot AI lite review requested due to automatic review settings September 8, 2026 22:35
@chatgpt-codex-connector

This comment was marked as off-topic.

This comment was marked as off-topic.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 69e87a79-6d98-4fa0-8470-591d02ba98b2

📥 Commits

Reviewing files that changed from the base of the PR and between e3c92b6 and d4cdbe2.

📒 Files selected for processing (12)
  • .github/workflows/clang.yml
  • README.md
  • include/avr/ConsoleHandler.h
  • include/avr/LegHandler.h
  • include/esp/ConsoleHandler.h
  • include/esp/DeskService.h
  • src/avr/ConsoleHandler.cpp
  • src/avr/ControllerService.cpp
  • src/avr/LegHandler.cpp
  • src/esp/ConsoleHandler.cpp
  • src/esp/DeskService.cpp
  • src/esp/HomeAssistantHandler.cpp

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Review details
🔇 Additional comments (13)
.github/workflows/clang.yml (1)

134-134: LGTM!

include/avr/LegHandler.h (1)

31-31: LGTM!

Also applies to: 93-98, 122-145

src/avr/ControllerService.cpp (1)

75-83: LGTM!

Also applies to: 97-105

src/avr/LegHandler.cpp (1)

5-5: LGTM!

Also applies to: 122-122

README.md (1)

199-212: LGTM!

include/esp/ConsoleHandler.h (1)

25-27: LGTM!

include/esp/DeskService.h (1)

18-30: LGTM!

Also applies to: 109-123

src/esp/ConsoleHandler.cpp (2)

91-117: LGTM!


182-186: LGTM!

src/esp/DeskService.cpp (3)

272-273: LGTM!


374-429: LGTM!


769-784: LGTM!

src/esp/HomeAssistantHandler.cpp (1)

310-319: LGTM!

Comment thread include/avr/ConsoleHandler.h
Comment thread src/esp/DeskService.cpp Outdated
Comment thread src/esp/DeskService.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

avr enhancement New feature or request esp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants