diff --git a/README.md b/README.md index 69ee3ef3..1eef5532 100644 --- a/README.md +++ b/README.md @@ -534,7 +534,7 @@ Add `add_days_to: True` to the configuration of all sensors you want to sort. Th ## How to add new sources -1. Create a new source in folder `custom_components/waste_collection_schedule/package/source` with the lower case url of your service provider (e.g. `abc_com.py` for `http://www.abc.com`). +1. Create a new source in folder `custom_components/waste_collection_schedule/waste_collection_schedule/source` with the lower case url of your service provider (e.g. `abc_com.py` for `http://www.abc.com`). 2. Don't forget to add test cases (= sample data to query the service api). 3. Run `test_sources.py` script to ensure that your source works. 4. Add documentation in folder `docs/source` and add a link to your new source on `README.md` and `info.md`. @@ -571,4 +571,4 @@ class Source: return entries ``` -See also: [custom_components/waste_collection_schedule/package/source/example.py](./custom_components/waste_collection_schedule/package/source/example.py) +See also: [custom_components/waste_collection_schedule/waste_collection_schedule/source/example.py](./custom_components/waste_collection_schedule/waste_collection_schedule/source/example.py) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/scraper.py b/custom_components/waste_collection_schedule/waste_collection_schedule/scraper.py index 6bdab04a..1ad9dc6e 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/scraper.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/scraper.py @@ -215,8 +215,8 @@ class Scraper: ): # load source module - # for home-assistant, use the last 3 folders, e.g. custom_component/wave_collection_schedule/package - # otherwise, only use package + # for home-assistant, use the last 3 folders, e.g. custom_component/wave_collection_schedule/waste_collection_schedule + # otherwise, only use waste_collection_schedule folders = os.path.normpath(os.path.dirname(__file__)).split(os.sep)[dir_offset:] path = ".".join(folders) + ".source." + source_name try: diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py b/custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py index 0013d2c5..dc50d181 100755 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py @@ -31,7 +31,7 @@ def main(): ) for f in files: - # iterate through all *.py files in package/source + # iterate through all *.py files in waste_collection_schedule/source print(f"Testing source {f} ...") module = importlib.import_module(f"waste_collection_schedule.source.{f}") diff --git a/doc/source/abfall_io.md b/doc/source/abfall_io.md index 09f06acc..0068454a 100644 --- a/doc/source/abfall_io.md +++ b/doc/source/abfall_io.md @@ -58,7 +58,7 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/abfall_io.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/abfall_io.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfall_io.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfall_io.py). Just run this script from a shell and answer the questions. diff --git a/doc/source/abfall_kreis_tuebingen_de.md b/doc/source/abfall_kreis_tuebingen_de.md index f76bd5f0..2e950db6 100644 --- a/doc/source/abfall_kreis_tuebingen_de.md +++ b/doc/source/abfall_kreis_tuebingen_de.md @@ -44,7 +44,7 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/abfall_kreis_tuebingen_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/abfall_kreis_tuebingen_de.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfall_kreis_tuebingen_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfall_kreis_tuebingen_de.py). Just run this script from a shell and answer the questions. diff --git a/doc/source/abfallnavi_de.md b/doc/source/abfallnavi_de.md index b756b944..a27917ca 100644 --- a/doc/source/abfallnavi_de.md +++ b/doc/source/abfallnavi_de.md @@ -45,6 +45,6 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/abfallnavi_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/abfallnavi_de.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfallnavi_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfallnavi_de.py). Just run this script from a shell and answer the questions. diff --git a/doc/source/awbkoeln_de.md b/doc/source/awbkoeln_de.md index 9fd3646b..5e13bb4e 100644 --- a/doc/source/awbkoeln_de.md +++ b/doc/source/awbkoeln_de.md @@ -36,6 +36,6 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/awbkoeln_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/awbkoeln_de.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/awbkoeln_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/awbkoeln_de.py). Just run this script from a shell and answer the questions. diff --git a/doc/source/bsr_de.md b/doc/source/bsr_de.md index ba894485..752fec60 100644 --- a/doc/source/bsr_de.md +++ b/doc/source/bsr_de.md @@ -36,6 +36,6 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/bsr_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/bsr_de.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/bsr_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/bsr_de.py). Just run this script from a shell and answer the questions. diff --git a/doc/source/muellmax_de.md b/doc/source/muellmax_de.md index aab8d383..65f26346 100644 --- a/doc/source/muellmax_de.md +++ b/doc/source/muellmax_de.md @@ -45,6 +45,6 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/muellmax_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/muellmax_de.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/muellmax_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/muellmax_de.py). Just run this script from a shell and answer the questions. diff --git a/doc/source/stadtreinigung_hamburg.md b/doc/source/stadtreinigung_hamburg.md index f4c117c6..e270dfa6 100644 --- a/doc/source/stadtreinigung_hamburg.md +++ b/doc/source/stadtreinigung_hamburg.md @@ -36,6 +36,6 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/stadtreinigung_hamburg.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/stadtreinigung_hamburg.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stadtreinigung_hamburg.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stadtreinigung_hamburg.py). Just run this script from a shell and answer the questions. diff --git a/doc/source/stuttgart_de.md b/doc/source/stuttgart_de.md index 166f59c9..5f8c764e 100644 --- a/doc/source/stuttgart_de.md +++ b/doc/source/stuttgart_de.md @@ -36,6 +36,6 @@ waste_collection_schedule: There is a script with an interactive command line interface which generates the required source configuration: -[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/stuttgart_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/package/wizard/stuttgart_de.py). +[https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stuttgart_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stuttgart_de.py). Just run this script from a shell and answer the questions.