Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for parsing new Poznan's waste collection schedule #3182

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

czyzniek
Copy link
Contributor

@czyzniek czyzniek commented Dec 11, 2024

It appears that Poznan once again changed page where they present schedule for wast collection. This PR should fix parsing this page. This PR fixes this bug #3183

@5ila5
Copy link
Collaborator

5ila5 commented Dec 18, 2024

Does this run for you, I get

    Traceback (most recent call last):
      File "/home/silas/Documents/python/hacs_waste_collection_schedule/./custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py", line 135, in test_fetch
        result = source.fetch()
                 ^^^^^^^^^^^^^^
      File "/home/silas/Documents/python/hacs_waste_collection_schedule/custom_components/waste_collection_schedule/waste_collection_schedule/source/poznan_pl.py", line 91, in fetch
        ICON_MAP[cell_index],
        ~~~~~~~~^^^^^^^^^^^^
    KeyError: 0

maybe you need to modify the icon map and use get instead of [] to preserve functionality even when the icon is unknown

@czyzniek
Copy link
Contributor Author

czyzniek commented Dec 18, 2024

Does this run for you, I get

    Traceback (most recent call last):
      File "/home/silas/Documents/python/hacs_waste_collection_schedule/./custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py", line 135, in test_fetch
        result = source.fetch()
                 ^^^^^^^^^^^^^^
      File "/home/silas/Documents/python/hacs_waste_collection_schedule/custom_components/waste_collection_schedule/waste_collection_schedule/source/poznan_pl.py", line 91, in fetch
        ICON_MAP[cell_index],
        ~~~~~~~~^^^^^^^^^^^^
    KeyError: 0

maybe you need to modify the icon map and use get instead of [] to preserve functionality even when the icon is unknown

Yeah you are right, I tested for a different street. Fixed root issue. RIght now should be working properly 👍

@5ila5 5ila5 linked an issue Dec 18, 2024 that may be closed by this pull request
7 tasks
@5ila5 5ila5 merged commit 729549e into mampfes:master Dec 18, 2024
2 checks passed
@5ila5
Copy link
Collaborator

5ila5 commented Dec 18, 2024

Thanks for your contribution

@5ila5 5ila5 mentioned this pull request Dec 18, 2024
7 tasks
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.

[Bug]: Poznan source is not working
2 participants