From ca7d9579f4de81e3441ffca3f17dd0a9fe84359c Mon Sep 17 00:00:00 2001 From: 5ila5 <5ila5@users.noreply.github.com> Date: Sun, 19 Nov 2023 14:49:05 +0100 Subject: [PATCH] fix republicservices holliday collection --- .../source/republicservices_com.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/republicservices_com.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/republicservices_com.py index 8c3756c821..bcee971835 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/republicservices_com.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/republicservices_com.py @@ -28,6 +28,9 @@ "No Method arg": { "street_address": "8957 Park Meadows Dr, Elk Grove, CA 95624", }, + "33865 Cassio Cir, Fremont, CA 94555": { + "street_address": "33865 Cassio Cir, Fremont, CA 94555", + }, } DELAYS = { " one ": 1, @@ -114,7 +117,6 @@ def fetch(self): } ) i += 1 - # Cycle through schedule and holidays incorporating delays while True: changes = 0 @@ -124,12 +126,10 @@ def fetch(self): d = holidays[holiday]["delay"] for pickup in schedule: p = schedule[pickup]["date"] - date_difference = (p - h).days - if date_difference <= 5 and date_difference >= 0: + if p == h: revised_date = p + timedelta(days=d) schedule[pickup]["date"] = revised_date holidays[holiday]["incorporated"] = True - # print(p, h, d, date_difference, revised_date) changes += 1 if changes == 0: break