Fix/issue 7306 gmina sroda slaska - #7308
Open
parencik wants to merge 1 commit into
Open
Conversation
parencik
force-pushed
the
fix/issue-7306-gmina-sroda-slaska
branch
from
September 3, 2026 09:25
4158203 to
2c26fe0
Compare
parencik
marked this pull request as ready for review
September 3, 2026 09:52
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The updated source should provide clearer, user-facing errors for legacy location_id configs and avoid unhelpful StopIteration failures when expected HTML structure is missing/changed.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes the gmina_sroda_slaska_pl source after Gmina Środa Śląska’s waste schedule provider changed, switching the integration to scrape the current public schedule exposed via the COM‑D service linked from the municipality’s official page.
Changes:
- Replaced the legacy API-based
location_idapproach with a COM‑D locality/district slug (location) and HTML parsing of COM‑D schedule pages. - Updated icons/type mapping to COM‑D category identifiers.
- Updated the source documentation to reflect the new argument and point to the municipality page as the authoritative reference.
File summaries
| File | Description |
|---|---|
| doc/source/gmina_sroda_slaska_pl.md | Updates documentation for the new location argument and official reference page. |
| custom_components/waste_collection_schedule/waste_collection_schedule/source/gmina_sroda_slaska_pl.py | Implements COM‑D scraping and replaces location_id with location (slug). |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
47
to
50
| class Source: | ||
| def __init__(self, location_id): | ||
| self._location_id = location_id | ||
| def __init__(self, location): | ||
| self._location = location | ||
|
|
Comment on lines
+58
to
+65
| schedule_table = next( | ||
| table | ||
| for table in soup.find_all("table") | ||
| if table.find("th", string="Frakcja") | ||
| ) | ||
| category_urls = { | ||
| link["href"] for link in schedule_table.select('a[href*="/sroda-slaska/"]') | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #7306
Updates the Gmina Środa Śląska source after the waste-collection provider changed.
The source now retrieves the current public schedule from COM-D, which is linked by the official Gmina Środa Śląska schedule page. The integration metadata and documentation reference the municipality page as the authoritative source.
The legacy
location_idrepresented groups of locations, while COM-D publishes schedules per locality or district. Users therefore need to replacelocation_idwith their COM-D URL slug, for examplelocation: szczepanow.Type of change
Checklist
python -m pytest tests/test_source_components.py -qpassesruff check --fixandruff formatrun on changed source filesdoc/source/<name>.mdcreated for new sources (not applicable; existing documentation updated)