diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/warszawa19115_pl.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/warszawa19115_pl.py index 4bc6e9652..51e2c0b56 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/warszawa19115_pl.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/warszawa19115_pl.py @@ -27,7 +27,7 @@ class SourceParseError(ValueError): OC_PARAMS = { "p_p_id": "portalCKMjunkschedules_WAR_portalCKMjunkschedulesportlet_INSTANCE_o5AIb2mimbRJ", "p_p_lifecycle": "2", - "p_p_resource_id": "", + "p_p_resource_id": "ajaxResource", } OC_HEADERS = { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", @@ -59,7 +59,7 @@ def get_geolocation_id(self, street_address) -> str: geolocation_request.raise_for_status() # Geolocation call requires 'autocompleteResourceURL' param to work - OC_PARAMS["p_p_resource_id"] = "autocompleteResourceURL" + OC_PARAMS["p_p_resource_id"] = "autocompleteResource" # Search for geolocation ID payload = f"_{OC_PARAMS['p_p_id']}_name={street_address}" @@ -95,14 +95,14 @@ def fetch(self): # When only an address is specified, get geolocation on first fetch if self._geolocation_id is None: self._geolocation_id = self.get_geolocation_id(self._street_address) - + # Calendar lookup cares about a cookie, so a Session must be used calendar_session = requests.Session() calendar_request = calendar_session.get(OC_URL) calendar_request.raise_for_status() # Calendar call requires 'ajaxResourceURL' param to work - OC_PARAMS["p_p_resource_id"] = "ajaxResourceURL" + OC_PARAMS["p_p_resource_id"] = "ajaxResource" payload = f"_{OC_PARAMS['p_p_id']}_addressPointId={str(self._geolocation_id)}" calendar_request = calendar_session.post(