robbrad / UKBinCollectionData

UK Council Bin Collection Data Parser Outputting Bin Data as a JSON
MIT License
105 stars 73 forks source link

Swale council producing an error #665

Open Chewbacca222222 opened 3 months ago

Chewbacca222222 commented 3 months ago

Name of Council

Swale

Issue Information

When setting up the integration I get this error:

This error originated from a custom integration.

Logger: custom_components.uk_bin_collection.sensor
Source: helpers/update_coordinator.py:315
integration: UK Bin Collection Data (documentation, issues)
First occurred: 11:54:50 (1 occurrences)
Last logged: 11:54:50

Unexpected error fetching Home data: Could not parse council website.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/uk_bin_collection/sensor.py", line 133, in _async_update_data
    data = await self.hass.async_add_executor_job(self.ukbcd.run)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 96, in run
    return self.client_code(
           ^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 115, in client_code
    return get_bin_data_class.template_method(address_url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 78, in template_method
    bin_data_dict = self.parse_data(
                    ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/councils/SwaleBoroughCouncil.py", line 34, in parse_data
    raise ConnectionAbortedError("Could not parse council website.")
ConnectionAbortedError: Could not parse council website.

Verification

dp247 commented 3 months ago

Looks like the council website has been updated since the parser was written

Chewbacca222222 commented 2 weeks ago

@dp247 @robbrad Is someone able to walk me through the project setup? I'm happy to give a go fixing the issue but I can't get it set up on my machine, even after multiple attempts!

dp247 commented 2 weeks ago

This is the way I set it up:

  1. Forked the repo to my GitHub account.
  2. Run the environment setup in Windows Terminal, then open the clone in Pycharm (I don't use venv, so my packages are installed to the system's version of Python, which I then use in Pycharm)
  3. In Pycharm, go to Run > Edit Configurations. I run Python 3.11 with the script set to the collect_data,py script. The run parameters (in the box below) can be found on the wiki - just don't include the python collect_data.py part.
  4. Open the council that I set run parameters for, then I can set breakpoints and debug.