Skip to content

Add API version to Duco diagnostics for support triage#169802

Merged
jbouwh merged 1 commit into
home-assistant:devfrom
ronaldvdmeer:feat/duco-diagnostics-api-metadata
May 5, 2026
Merged

Add API version to Duco diagnostics for support triage#169802
jbouwh merged 1 commit into
home-assistant:devfrom
ronaldvdmeer:feat/duco-diagnostics-api-metadata

Conversation

@ronaldvdmeer
Copy link
Copy Markdown
Contributor

@ronaldvdmeer ronaldvdmeer commented May 5, 2026

Proposed change

The Duco diagnostics payload currently only reports the device's host address, config entry data, and board info. This PR extends it so that when a user downloads diagnostics for a support request, the output also includes:

  • API info (public_api_version and, when present, reported_api_version) fetched live from the device via async_get_api_info()
  • Board info fields public_api_version and software_version (added in python-duco-client 0.4.0) are included when available, so the exact firmware version is visible without asking the user

Optional fields (reported_api_version, public_api_version on board, software_version on board) are only included when the device actually returns them, keeping the payload clean for older hardware.

The time field is stripped from board info because it is a raw Unix epoch timestamp that adds no value for support triage.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

python-duco-client 0.4.0 is a prerequisite; that bump was merged separately in #169776.

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the Duco diagnostics payload so support downloads include more live device metadata and newer board firmware details, improving troubleshooting for this platinum-quality local integration.

Changes:

  • Adds live API metadata to Duco diagnostics and includes newer board firmware/API version fields when available.
  • Removes the board time value from diagnostics and keeps sensitive identifiers redacted.
  • Updates Duco diagnostics fixtures, snapshot data, and connection-error coverage for the new live API call.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
homeassistant/components/duco/diagnostics.py Extends diagnostics collection with API info and filters optional board fields.
tests/components/duco/conftest.py Adds mock API/board data needed for the expanded diagnostics payload.
tests/components/duco/test_diagnostics.py Updates diagnostics tests for the new payload and API-info failure path.
tests/components/duco/snapshots/test_diagnostics.ambr Refreshes the expected diagnostics snapshot with the new fields.

Comment thread homeassistant/components/duco/diagnostics.py
@ronaldvdmeer ronaldvdmeer force-pushed the feat/duco-diagnostics-api-metadata branch from 8e5d8e8 to 20d682f Compare May 5, 2026 09:46
@ronaldvdmeer ronaldvdmeer marked this pull request as ready for review May 5, 2026 09:46
Copilot AI review requested due to automatic review settings May 5, 2026 09:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@ronaldvdmeer
Copy link
Copy Markdown
Contributor Author

ronaldvdmeer commented May 5, 2026

Important

Could a maintainer add the new-feature label? The CI check requires at least one of the required labels and contributors don't have permission to set labels.

@ronaldvdmeer ronaldvdmeer changed the title Harden Duco diagnostics for support triage Add API version to Duco diagnostics for support triage May 5, 2026
Copy link
Copy Markdown
Contributor

@jbouwh jbouwh left a comment

Choose a reason for hiding this comment

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

LGTM,
Thanks @ronaldvdmeer 👍

@jbouwh jbouwh merged commit 0ec5d6b into home-assistant:dev May 5, 2026
36 of 37 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
@frenck frenck added this to the 2026.5.2 milestone May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden Duco diagnostics for support triage

4 participants