Add Data Grand Lyon integration#167946
Conversation
11f3728 to
af56b68
Compare
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
{
1e1d56d to
ea8ae45
Compare
ea8ae45 to
2125708
Compare
2125708 to
c056273
Compare
| 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") |
There was a problem hiding this comment.
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.
| 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" | |
| ) |
| LOGGER.warning( | ||
| "Error fetching passages for stop %s: %s", | ||
| subentry.subentry_id, | ||
| result, | ||
| ) |
There was a problem hiding this comment.
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.
| if isinstance(velov_result, BaseException): | ||
| LOGGER.warning( | ||
| "Error fetching Vélo'v station %s: %s", | ||
| subentry.subentry_id, | ||
| velov_result, | ||
| ) |
There was a problem hiding this comment.
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.
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>
c056273 to
ab0f34c
Compare
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
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests:
Enregistrement d'écran_20260411_104705.webm
Enregistrement d'écran_20260411_104606.webm