From c3b1c922f42b987c289d97e90d9bc8dcfcd1966b Mon Sep 17 00:00:00 2001 From: Evgeniy Timokhov Date: Thu, 26 Dec 2024 23:41:07 +0000 Subject: [PATCH] Added arguments description and how to get them to metainfo --- .../translations/de.json | 4 ++-- .../translations/en.json | 15 +++++++++++---- .../translations/it.json | 4 ++-- .../source/royalgreenwich_gov_uk.py | 16 ++++++++++++++-- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/custom_components/waste_collection_schedule/translations/de.json b/custom_components/waste_collection_schedule/translations/de.json index f764af31e..3f6163f6b 100644 --- a/custom_components/waste_collection_schedule/translations/de.json +++ b/custom_components/waste_collection_schedule/translations/de.json @@ -15650,7 +15650,7 @@ }, "args_royalgreenwich_gov_uk": { "title": "Quelle konfigurieren", - "description": "Konfiguriere deinen Service Provider. Mehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md", + "description": "Konfiguriere deinen Service Provider. \n\nUsing a browser, go to [royalgreenwich.gov.uk](https://www.royalgreenwich.gov.uk/info/200171/recycling_and_rubbish/100/find_your_bin_collection_day). Find the collection day and the first bold text in the message below the search bar (right after \"At\" and before \":\") is your address, use it as-is.\n\nMehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md", "data": { "calendar_title": "Kalender Titel", "address": "Addresse", @@ -15663,7 +15663,7 @@ }, "reconfigure_royalgreenwich_gov_uk": { "title": "Quelle Neu Konfigurieren", - "description": "Konfiguriere deinen Service Provider. Mehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md", + "description": "Konfiguriere deinen Service Provider. \n\nUsing a browser, go to [royalgreenwich.gov.uk](https://www.royalgreenwich.gov.uk/info/200171/recycling_and_rubbish/100/find_your_bin_collection_day). Find the collection day and the first bold text in the message below the search bar (right after \"At\" and before \":\") is your address, use it as-is.\n\nMehr details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md", "data": { "calendar_title": "Kalender Titel", "address": "Addresse", diff --git a/custom_components/waste_collection_schedule/translations/en.json b/custom_components/waste_collection_schedule/translations/en.json index ec2100137..6454fd16b 100644 --- a/custom_components/waste_collection_schedule/translations/en.json +++ b/custom_components/waste_collection_schedule/translations/en.json @@ -15673,7 +15673,7 @@ }, "args_royalgreenwich_gov_uk": { "title": "Configure Source", - "description": "Configure your service provider. More details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", + "description": "Configure your service provider. \n\nUsing a browser, go to [royalgreenwich.gov.uk](https://www.royalgreenwich.gov.uk/info/200171/recycling_and_rubbish/100/find_your_bin_collection_day). Find the collection day and the first bold text in the message below the search bar (right after \"At\" and before \":\") is your address, use it as-is.\n\nMore details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", "data": { "calendar_title": "Calendar Title", "address": "Address", @@ -15681,19 +15681,26 @@ "post_code": "Postcode" }, "data_description": { - "calendar_title": "A more readable, or user-friendly, name for the waste calendar. If nothing is provided, the name returned by the source will be used." + "calendar_title": "A more readable, or user-friendly, name for the waste calendar. If nothing is provided, the name returned by the source will be used.", + "address": "Full address", + "house": "House number or name", + "post_code": "Postcode" } }, "reconfigure_royalgreenwich_gov_uk": { "title": "Reconfigure Source", - "description": "Configure your service provider. More details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", + "description": "Configure your service provider. \n\nUsing a browser, go to [royalgreenwich.gov.uk](https://www.royalgreenwich.gov.uk/info/200171/recycling_and_rubbish/100/find_your_bin_collection_day). Find the collection day and the first bold text in the message below the search bar (right after \"At\" and before \":\") is your address, use it as-is.\n\nMore details: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", "data": { "calendar_title": "Calendar Title", "address": "Address", "house": "House", "post_code": "Postcode" }, - "data_description": {} + "data_description": { + "address": "Full address", + "house": "House number or name", + "post_code": "Postcode" + } }, "args_runnymede_gov_uk": { "title": "Configure Source", diff --git a/custom_components/waste_collection_schedule/translations/it.json b/custom_components/waste_collection_schedule/translations/it.json index 0f373083a..0a902ee0f 100644 --- a/custom_components/waste_collection_schedule/translations/it.json +++ b/custom_components/waste_collection_schedule/translations/it.json @@ -15632,7 +15632,7 @@ }, "args_royalgreenwich_gov_uk": { "title": "Configurazione Sorgente", - "description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. Maggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", + "description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. \n\nUsing a browser, go to [royalgreenwich.gov.uk](https://www.royalgreenwich.gov.uk/info/200171/recycling_and_rubbish/100/find_your_bin_collection_day). Find the collection day and the first bold text in the message below the search bar (right after \"At\" and before \":\") is your address, use it as-is.\n\nMaggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", "data": { "calendar_title": "Nome Calendario", "address": "Address", @@ -15645,7 +15645,7 @@ }, "reconfigure_royalgreenwich_gov_uk": { "title": "Riconfigurazione Sorgente", - "description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. Per maggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", + "description": "Compila i campi per ottenere le informazioni sul tuo servizio di raccolta. \n\nUsing a browser, go to [royalgreenwich.gov.uk](https://www.royalgreenwich.gov.uk/info/200171/recycling_and_rubbish/100/find_your_bin_collection_day). Find the collection day and the first bold text in the message below the search bar (right after \"At\" and before \":\") is your address, use it as-is.\n\nPer maggiori informazioni: https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/doc/source/royalgreenwich_gov_uk.md.", "data": { "calendar_title": "Nome Calendario", "address": "Address", diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/royalgreenwich_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/royalgreenwich_gov_uk.py index 78e93708f..244e52fc0 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/royalgreenwich_gov_uk.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/royalgreenwich_gov_uk.py @@ -27,10 +27,22 @@ "food": "mdi:food-apple", } +#### Arguments affecting the configuration GUI #### -class InsufficientDataError(Exception): - pass +HOW_TO_GET_ARGUMENTS_DESCRIPTION = { # Optional dictionary to describe how to get the arguments, will be shown in the GUI configuration form above the input fields, does not need to be translated in all languages + "en": "Using a browser, go to [royalgreenwich.gov.uk](https://www.royalgreenwich.gov.uk/info/200171/recycling_and_rubbish/100/find_your_bin_collection_day). " + "Find the collection day and the first bold text in the message below the search bar (right after \"At\" and before \":\") is your address, use it as-is." +} + +PARAM_DESCRIPTIONS = { # Optional dict to describe the arguments, will be shown in the GUI configuration below the respective input field + "en": { + "post_code": "Postcode", + "house": "House number or name", + "address": "Full address", + } +} +#### End of arguments affecting the configuration GUI #### class Source: def __init__(