Skip to content

Add Data Grand Lyon integration#167946

Open
Crocmagnon wants to merge 1 commit intohome-assistant:devfrom
Crocmagnon:devel/Crocmagnon/tcl
Open

Add Data Grand Lyon integration#167946
Crocmagnon wants to merge 1 commit intohome-assistant:devfrom
Crocmagnon:devel/Crocmagnon/tcl

Conversation

@Crocmagnon
Copy link
Copy Markdown

@Crocmagnon Crocmagnon commented Apr 10, 2026

Proposed change

New integration for Data Grand Lyon open data platform. Supports config subentries for transit stops (with estimated/theoretical passage merging) and bike sharing stations (with electrical/mechanical bike breakdown).

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

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 (documentation TODO)
  • 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:

Enregistrement d'écran_20260411_104705.webm
Enregistrement d'écran_20260411_104606.webm

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

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new tcl Home Assistant integration for Lyon (TCL) public transit and Vélo'v bike-sharing, including config flows with subentries and sensor entities backed by a coordinator.

Changes:

  • Adds TCL integration implementation (config flow + coordinator + sensor platform + translations/manifest/quality scale).
  • Adds automated tests for the integration’s config flow and subentry flows.
  • Registers the integration in generated indices and adds the upstream dependency to requirements.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
tests/components/tcl/test_config_flow.py Adds config flow + subentry flow tests for TCL integration.
tests/components/tcl/conftest.py Adds shared fixture to patch async_setup_entry during tests.
tests/components/tcl/init.py Adds tests package marker for TCL.
requirements_test_all.txt Adds transports-commun-lyon to the test requirements set.
requirements_all.txt Adds transports-commun-lyon to the runtime requirements set.
homeassistant/generated/integrations.json Registers the new tcl integration for discovery/metadata.
homeassistant/generated/config_flows.py Registers tcl as supporting config flows.
homeassistant/components/tcl/strings.json Adds UI strings for config flow, subentries, and entity translations.
homeassistant/components/tcl/sensor.py Implements stop and Vélo'v sensors using the coordinator pattern.
homeassistant/components/tcl/quality_scale.yaml Declares current quality-scale rule status for the new integration.
homeassistant/components/tcl/manifest.json Adds manifest metadata and pins dependency version.
homeassistant/components/tcl/coordinator.py Adds coordinator to fetch/merge passages and fetch station status.
homeassistant/components/tcl/const.py Defines constants for keys/subentry types and passage count.
homeassistant/components/tcl/config_flow.py Implements main config flow, reauth, and subentry flows.
homeassistant/components/tcl/init.py Wires up coordinator, update listener, and forwards platform setup.
CODEOWNERS Assigns ownership for new integration code and tests.

Copilot AI review requested due to automatic review settings April 10, 2026 22:27
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 15 out of 17 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

homeassistant/components/tcl/manifest.json:1

  • The manifest includes several empty fields (dependencies, homekit, ssdp, zeroconf). If these are not intentionally required by hassfest for this integration, consider removing them to reduce noise and keep the manifest focused on meaningful declarations.
{

@Crocmagnon Crocmagnon marked this pull request as draft April 10, 2026 22:31
Copilot AI review requested due to automatic review settings April 10, 2026 22:39
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 15 out of 17 changed files in this pull request and generated 6 comments.

Copilot AI review requested due to automatic review settings April 10, 2026 22:47
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 15 out of 17 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings April 10, 2026 22:51
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 15 out of 17 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings April 10, 2026 23:00
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 16 out of 18 changed files in this pull request and generated 2 comments.

Copilot AI review requested due to automatic review settings April 11, 2026 08:11
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 15 out of 17 changed files in this pull request and generated 2 comments.

@Crocmagnon Crocmagnon changed the title Add TCL (Transports en commun à Lyon - Lyon public transit network) integration Add Data Grand Lyon integration Apr 11, 2026
Copilot AI review requested due to automatic review settings April 11, 2026 13:28
@Crocmagnon Crocmagnon force-pushed the devel/Crocmagnon/tcl branch from 1e1d56d to ea8ae45 Compare April 11, 2026 13:28
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 17 out of 19 changed files in this pull request and generated 7 comments.

@Crocmagnon Crocmagnon force-pushed the devel/Crocmagnon/tcl branch from ea8ae45 to 2125708 Compare April 11, 2026 13:43
@Crocmagnon Crocmagnon force-pushed the devel/Crocmagnon/tcl branch from 2125708 to c056273 Compare April 11, 2026 14:14
@Crocmagnon Crocmagnon marked this pull request as ready for review April 11, 2026 14:14
Copilot AI review requested due to automatic review settings April 11, 2026 14:14
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 17 out of 19 changed files in this pull request and generated 6 comments.

velov[subentry.subentry_id] = velov_result

if (stop_subentries or velov_subentries) and not stops and not velov:
raise UpdateFailed("Error fetching DataGrandLyon data: all requests failed")
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

The UpdateFailed message is user/diagnostic-facing and currently uses an internal-looking name (DataGrandLyon) and doesn’t provide actionable context. Consider using the proper integration name (Data Grand Lyon) and adding minimal detail (e.g., number of stop/station requests and that all failed) to improve troubleshooting without being overly verbose.

Suggested change
raise UpdateFailed("Error fetching DataGrandLyon data: all requests failed")
raise UpdateFailed(
f"Error fetching Data Grand Lyon data: all {len(stop_subentries)} "
f"stop request(s) and {len(velov_subentries)} Vélo'v station "
"request(s) failed"
)

Copilot uses AI. Check for mistakes.
Comment on lines +89 to +93
LOGGER.warning(
"Error fetching passages for stop %s: %s",
subentry.subentry_id,
result,
)
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

These warnings drop the traceback even though you have the actual exception object. Logging with exc_info=... (or using LOGGER.exception where appropriate) would preserve stack traces, which materially improves field diagnostics when API/library failures occur.

Copilot uses AI. Check for mistakes.
Comment on lines +100 to +105
if isinstance(velov_result, BaseException):
LOGGER.warning(
"Error fetching Vélo'v station %s: %s",
subentry.subentry_id,
velov_result,
)
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

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

These warnings drop the traceback even though you have the actual exception object. Logging with exc_info=... (or using LOGGER.exception where appropriate) would preserve stack traces, which materially improves field diagnostics when API/library failures occur.

Copilot uses AI. Check for mistakes.
New integration for Data Grand Lyon open data platform.
Supports config subentries for transit stops (with estimated/theoretical
passage merging) and bike sharing stations (with electrical/mechanical bike
breakdown).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Crocmagnon Crocmagnon force-pushed the devel/Crocmagnon/tcl branch from c056273 to ab0f34c Compare April 11, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants