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

[Bug]: Inner west source doesn't handle organic bin collection correctly (API is bit borked) #2736

Closed
7 tasks done
Samdoescode opened this issue Sep 24, 2024 · 1 comment
Closed
7 tasks done

Comments

@Samdoescode
Copy link

I Have A Problem With:

A specific source

What's Your Problem

This is not a bug but rather an oddity with this particular source which seems to have been changed since the initial implementation.

I installed waste collection as describes in the instillation documentation and saw that for each of the event.types waste and Recycling I was getting expected behaviour, but for the organic collection I was not getting any returns.

I dug in a little and pulled the API up to see what was being returned (I had assumed the API would be the problem rather then the integration). This is the return;

[ { "property": { "collection_day": 1, "collection_day_2": null, "zone": "[my zone]", "shs": null, "bin_bank_id": null, "clean_up_code": null, "address": "[my address]", "collections": [ { "id": 52, "bin_type": "recycle", "recurrence": "fortnightly", "collection_day": 10, "next_collection_date": null } ] }, "color": "#44D62C", "textColor": "#44D62C", "borderColor": "#000", "dow": [ 1 ], "daysOfWeek": [ 1 ], "start_date": "2024-09-23", "event_type": "organic" }, { "color": "#EF3340", "textColor": "#EF3340", "borderColor": "#000", "start": "2024-09-30", "event_type": "waste" }, { "color": "#EF3340", "textColor": "#EF3340", "borderColor": "#000", "start": "2024-10-14", "event_type": "waste" }, { "startHalfDay": true, "color": "#FEDB00", "textColor": "#FEDB00", "borderColor": "#000", "start": "2024-09-30", "event_type": "recycle" }, { "startHalfDay": true, "color": "#FEDB00", "textColor": "#FEDB00", "borderColor": "#000", "start": "2024-10-14", "event_type": "recycle" } ]

at the bottom of this json are the correctly formatted responses which I am seeing in HA 2 "waste" event types and 2 "recycle" event types. It appears the organic waste does not have independent collection objects but just has a "weekly" flag on the property object and a start date. I guess for this roll out of organic waste they have just turned it "on" and set it to "monday". This is quite a poor implementation from the API tbh. Why they did not simply add more collections objects we may never know...

I'm not sure if this is able to be handled by the parser. Outside of writing another function after the return to create dummy entries for the month, add them to the original response and feed them down stream.

I doubt this is a "bug" is widespread enough to warrant fixing, please close if so. But I thought I would flag it just in case a simple fix is possible.

Thanks

Source (if relevant)

innerwest_nsw_gov_au

Logs

no relevant logs

Relevant Configuration

No response

Checklist Source Error

  • Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  • Checked that the website of your service provider is still working
  • Tested my attributes on the service provider website (if possible)
  • I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)

Checklist Sensor Error

  • Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)

Required

  • I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@Samdoescode
Copy link
Author

Did do a search but didn't see that this relates to #1362 so will close

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

No branches or pull requests

1 participant