Skip to content

Fix/issue 7306 gmina sroda slaska - #7308

Open
parencik wants to merge 1 commit into
mampfes:masterfrom
parencik:fix/issue-7306-gmina-sroda-slaska
Open

Fix/issue 7306 gmina sroda slaska#7308
parencik wants to merge 1 commit into
mampfes:masterfrom
parencik:fix/issue-7306-gmina-sroda-slaska

Conversation

@parencik

@parencik parencik commented Sep 3, 2026

Copy link
Copy Markdown

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_id represented groups of locations, while COM-D publishes schedules per locality or district. Users therefore need to replace location_id with their COM-D URL slug, for example location: szczepanow.

Type of change

  • New source
  • Bug fix / source fix
  • Documentation update
  • Other

Checklist

  • python -m pytest tests/test_source_components.py -q passes
  • ruff check --fix and ruff format run on changed source files
  • No generated files in diff (README.md, info.md, sources.json, translations/*.json — CI regenerates these post-merge)
  • doc/source/<name>.md created for new sources (not applicable; existing documentation updated)
  • TEST_CASES use real, publicly accessible addresses (not my own)

@parencik
parencik force-pushed the fix/issue-7306-gmina-sroda-slaska branch from 4158203 to 2c26fe0 Compare September 3, 2026 09:25
@parencik
parencik marked this pull request as ready for review September 3, 2026 09:52
@bbr111
bbr111 requested a lite review from Copilot September 6, 2026 20:20
@bbr111 bbr111 self-assigned this Sep 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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_id approach 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/"]')
}
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.

[Source Defect]: Sroda slaska stopped working since september

3 participants