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

Fixing problem where organic isn't shown properly #1362

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"waste": "mdi:trash-can",
"recycle": "mdi:recycle",
"organic": "mdi:leaf",
"special": "mdi:star",
}


Expand Down Expand Up @@ -114,23 +115,24 @@ def fetch(self):
entries = []

for item in data:
if "start" not in item and "start_date" not in item:
continue
key = (
"start"
if "start" in item
else "start_date"
if "start_date" in item
else ""
)
collection_date = date.fromisoformat(item[key])
if (collection_date - today).days >= 0:
entries.append(
Collection(
date=collection_date,
t=item["event_type"],
icon=ICON_MAP.get(item["event_type"]),
if "start" in item:
collection_date = date.fromisoformat(item["start"])
if (collection_date - today).days >= 0:
# Only consider recycle and waste events as they are fortnightly
if item["event_type"] in ["recycle", "waste"]:
# Every collection day includes organic
entries.append(
Collection(
date=collection_date, t="organic", icon="mdi:leaf"
)
)

entries.append(
Collection(
date=collection_date,
t=item["event_type"],
icon=ICON_MAP.get(item["event_type"]),
)
)
)

return entries
9 changes: 9 additions & 0 deletions doc/source/innerwest_nsw_gov_au.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,12 @@ waste_collection_schedule:
## How to get the source arguments

Visit the [Inner West Council (NSW)](https://www.innerwest.nsw.gov.au/live/waste-and-recycling/bins-and-clean-ups/waste-calendar) page and search for your address. The arguments should exactly match the results shown for Suburb and Street and the number portion of the Property.

## Known collection types

The following is a list of known collection types (`event_type` in the API):

- organic
- waste
- recycle
- special
Loading