From 0f594771abeef3f328d0949033f35f3e6890daa9 Mon Sep 17 00:00:00 2001 From: dt215git <86194065+dt215git@users.noreply.github.com> Date: Fri, 18 Oct 2024 11:06:34 +0100 Subject: [PATCH] Fix: Ku-Ring_gai (#2851) * icon map and round dicts updated * api response means ROUNDS dict no longer needed --- .../source/kuringgai_nsw_gov_au.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/kuringgai_nsw_gov_au.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/kuringgai_nsw_gov_au.py index b73b47433..606e7664c 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/kuringgai_nsw_gov_au.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/kuringgai_nsw_gov_au.py @@ -55,19 +55,11 @@ } ICON_MAP = { - "GeneralWaste": "mdi:trash-can", + "General Waste": "mdi:trash-can", "Recycling": "mdi:recycle", - "GreenWaste": "mdi:leaf", + "Green Waste": "mdi:leaf", } -ROUNDS = { - "GeneralWaste": "General Waste", - "Recycling": "Recycling", - "GreenWaste": "Green Waste", -} - -# _LOGGER = logging.getLogger(__name__) - class Source: def __init__( @@ -133,10 +125,7 @@ def fetch(self): entries.append( Collection( date=date, - # t=waste_type, # api returns GeneralWaste, Recycling, GreenWaste - t=ROUNDS.get( - waste_type - ), # returns user-friendly General Waste, Recycling, Green Waste + t=waste_type, icon=ICON_MAP.get(waste_type), ) )