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

Add a generic source for publidata based French areas + specific instances #2824

Merged
merged 7 commits into from
Oct 12, 2024

Conversation

vinzd
Copy link
Contributor

@vinzd vinzd commented Oct 11, 2024

Support for schedules provided by Publidata.

They operate the schedules of at least the following communities:

  • GPSEO
  • Orléans Métropole
  • Tours métropole

A specific source is provided for GPSEO, Orléans Métropole and Tours Métropole, and the generic one is also available but requires the user to provide a parameter found by inspecting network from a browser.

The reason going for both the generic and specic approaches is to both improve discoverability of the integration for inhabitants from the three mentioned areas, and still leave the possibility to some more adventurous users from other, covered by publidata places, to benefit from it.

It’s a more generic, counter-proposal to #2550 with thanks to @Crazyscorpio88, which closes #2547.

Vincent Desprez added 2 commits October 11, 2024 18:10
…ances

Support for schedules provided by [Publidata](https://www.publidata.io/fr/).

They operate the schedules of at least the following communities:

- GPSEO
- Orléans Métropole
- Tours métropole

A specific source is provided for GPSEO, Orléans Métropole and Tours Métropole.

The reason going for both the generic and specic approaches is to both
improve discoverability of the integration for inhabitants from the
three mentioned areas, and still leave the possibility to some more
adventurous users from other, covered by publidata places, to benefit
from it.
@5ila5
Copy link
Collaborator

5ila5 commented Oct 12, 2024

Thanks for your work, but I don't think extra sources that do nothing but inherit from the other source is a good idea:

For discoverability, there is the EXTRA_INFO dict (or function returning a dict) you can put in the source file it will show up in the README.md and in the HA config_flow (GUI configuration wizard) and if you select this extra info the default_params will be set

So this has basically all the advantages of an extra source without the drawback of additional python scripts and md files to look after.

EXTRA_INFO = [
    {"title": "GPSEO Waste Collection", "url": "https://dechets.gpseo.fr/", "default_params": {"instance_id": 1292}},
    {"title": "Orléans Métropole Waste Collection", "url": "https://triermondechet.orleans-metropole.fr/", "default_params": {"instance_id": 100}},
    {"title": "Tours Métropole Waste Collection", "url": "https://www.tours-metropole.fr/", "default_params": {"instance_id": 65}},
]

- Drop inheritance in favor of EXTRA_INFO, thanks @5ila5
- Align icons on mampfes#2814
- Add more instances: Châteauroux, Saint Quentin en Yvelines, Saumur,
  Versailles
@vinzd
Copy link
Contributor Author

vinzd commented Oct 12, 2024

Thanks @5ila5, it’s much better with EXTRA_INFO indeed! It’s updated consequently.

@5ila5 5ila5 merged commit f87fe88 into mampfes:master Oct 12, 2024
2 checks passed
@5ila5
Copy link
Collaborator

5ila5 commented Oct 12, 2024

Thanks for your contribution

I did some reformatting (pre-commit)

@Crazyscorpio88
Copy link

Hello @vinzd and @5ila5
Indeed this PR is better NOW, GPSEO change the method recently. I had sent a message to someone inside GPSEO so they open their APIs or do the same as other with Publidata.
You can add also GPSO : https://dechets.seineouest.fr/bpVpXtGXVg/

Wich will allow other French people to get their data !

Thanks,
I will try it on my side, I recently had a new baby so Time flies...

@vinzd vinzd deleted the vd-add-gpseo-source branch October 25, 2024 19:03
@GilDev
Copy link

GilDev commented Nov 22, 2024

Amazing! Thanks!

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 Request]: GPSEO (Grand Paris Seine & Oise)
4 participants