Skip to content

Fix tag type definition loading and add automated sync workflow#3

Merged
Misiu merged 5 commits intomainfrom
copilot/fix-config-flow-error
Feb 11, 2026
Merged

Fix tag type definition loading and add automated sync workflow#3
Misiu merged 5 commits intomainfrom
copilot/fix-config-flow-error

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 11, 2026

BLE device config flow failed on first setup with 404 errors when fetching tag type definitions. Integration is a fork of OpenEPaperLink but URLs pointed to non-existent OpenDisplay/OpenDisplay repository.

Changes

Fixed repository URLs

# Before (404)
GITHUB_API_URL = "https://api.github.com/repos/OpenDisplay/OpenDisplay/contents/resources/tagtypes"

# After (correct upstream)
GITHUB_API_URL = "https://api.github.com/repos/OpenEPaperLink/OpenEPaperLink/contents/resources/tagtypes"

Expanded fallback definitions

  • 7 minimal types → 93 comprehensive types matching upstream
  • Added required version field (was missing, causing validation issues)
  • Removed optional bpp, rotatebuffer fields (TagType provides defaults)
  • Type 226 (hex E2): correctly maps to "LILYGO TPANEL 4""

Made config flow resilient

# ATC device setup now handles tag type failures gracefully
tag_types_manager = None
try:
    tag_types_manager = await get_tag_types_manager(self.hass)
except Exception:
    _LOGGER.warning("Tag types unavailable, using protocol-detected values")
# Falls back to protocol capabilities if tag types unavailable

Added automated sync workflow

  • Schedule: Weekly (Monday 00:00 UTC) + manual trigger
  • Process: Fetches upstream definitions → compares → creates PR if changed
  • Safe: Creates PR for review, no auto-merge
  • Location: .github/workflows/sync-tag-definitions.yml

Result

Device setup succeeds even when GitHub is unreachable or on first run with no cached data. Fallback definitions stay current via automated weekly sync.

Original prompt

This section details on the original issue you should resolve

<issue_title>Error during config flow - Failed to load tag type definitions</issue_title>
<issue_description>Describe the bug
The integration discovered by device, but when trying to add it I got this error:

Image

After a retry the device is added correctly.

To Reproduce
Add integration, flash any device with OpenEpaperLink, power the device and wait for the integration to catch it up. When you try to add it, you will get the error message

Expected behavior
The device should be added without any errors.

Screenshots
Added above

Additional context

2026-02-06 12:59:36.000 ERROR (MainThread) [custom_components.opendisplay.tag_types] Error fetching tag types: GitHub API returned status 404
2026-02-06 12:59:36.001 ERROR (MainThread) [custom_components.opendisplay.config_flow] Unexpected error during device interrogation: Failed to load tag type definitions. No stored data available. Check network connectivity or GitHub access

</issue_description>

<agent_instructions>the error is shown when we try to download the definitions for the first time. When I try to add/submit the config flow, the device is added correctly. so maybe there are some issues with downloading the definitions.
the url doesn't exists in my repo, the right one is https://github.com/OpenEPaperLink/OpenEPaperLink/tree/master/resources/tagtypes

this integration is a rename and a fork of the old one, this is probably why the urls was changed, but to the wrong one.

Please check how we detect type of display, as in theory this integration supports two types: openepaperlink and opendisplay.

add logs if needed</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error during config flow for device integration Fix tag type definitions GitHub URL and add graceful fallback handling Feb 11, 2026
Copilot AI requested a review from Misiu February 11, 2026 10:29
…erLink

Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
Copilot AI changed the title Fix tag type definitions GitHub URL and add graceful fallback handling Fix tag type definitions: correct GitHub URL and add comprehensive fallback types Feb 11, 2026
Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
Copilot AI changed the title Fix tag type definitions: correct GitHub URL and add comprehensive fallback types Fix tag type definitions: correct GitHub URL and add comprehensive fallback Feb 11, 2026
Co-authored-by: Misiu <1741838+Misiu@users.noreply.github.com>
Copilot AI changed the title Fix tag type definitions: correct GitHub URL and add comprehensive fallback Fix tag type definition loading and add automated sync workflow Feb 11, 2026
@Misiu Misiu marked this pull request as ready for review February 11, 2026 10:51
@Misiu Misiu merged commit 06efa7e into main Feb 11, 2026
1 of 3 checks passed
@Misiu Misiu deleted the copilot/fix-config-flow-error branch February 12, 2026 07:31
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.

Error during config flow - Failed to load tag type definitions

2 participants