-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
citiesapps_com: Update to citiesapp v2 api #3461
Conversation
raise SourceArgumentNotFoundWithSuggestions( | ||
"calendar", [calendar["name"] for calendar in calendars] | ||
"calendar", [calendar["street"] for calendar in calendars] | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the Excption call is wrong (from before you touched it) it should be
raise SourceArgumentNotFoundWithSuggestions(
"city", search, [city["name"] for city in cities]
)
in get_specific_citiy
and
raise SourceArgumentNotFoundWithSuggestions(
"calendar", search, [calendar["street"] for calendar in calendars]
)
here.
Some of the test cases seem to fail
I don't think we can fix existing configurations with old calendar names, but could you fix the test cases? |
Thanks for the feedback @5ila5, will look into it and update the PR. |
I made the changed, but after reconfiguration, I still don't get the waste type in the calendar. thx |
@overide6 Thank you for testing this. This seems to be the same issue as for Fürstenfeld, which I already have a fix for. In my initial code I did not handle the pagination, so Unterfladnitz is not returned from the API. I will update the PR here once I'm done testing. |
Short update from my side: I'm not fully done yet, due to time constraints. I hope to have a working version by Monday. @overide6 As a quick workaround you can replace:
with
in |
@lbloder could you tell me where to find it? |
@5ila5 @overide6 maybe you could try the new implementation to see if that works for you. |
@lbloder |
"data": api.fetch_garbage_plans(city_dict, calendar) | ||
} | ||
|
||
def get_garbage_calendars(self, city_id: str) -> list: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type hinted as returning list, but returns dict[str, bool|list]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thank you, will update.
The |
Looks like they migrated to the calendar v2 api in the meantime 🤦 . This was basically the reason I built it so we can handle both v1 and v2 :). |
…update Rudersdorf test case
Updated the Rudersdorf test case and added a suggestion to re-check the App if no calendar could be found. Also, looks like they are migrating all cities to v2, as of this writing, there are only 7 cities left on v1. Did some spot checking and it seems like they don't return any up-to-date data. Guessing they will also be migrated to v2 when new data is available. Once all cities are on v2 we can probably remove all the v1 code. |
Sounds good. I'll merge this, and we can do this in a new PR when they moved over. |
Fixes #3460
Updates citiesapp related code to use v2 api.
Also updates wizard to be compatible.
@mampfes Thank you and all the contributors for your work on this integration. Its much appreciated. Also note that I am not a python developer, so any suggestions are welcome :)