Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### Directory and File Handling

- In the `custom_components/polleninformation/translations/` directory, only process the `en.json` file. All other files in this directory must be ignored.
- In the `custom_components/polleninformation/translations/` directory, only edit the `en.json` file for content changes (new strings, rewording, etc.). Mechanical changes required for validation compliance (e.g. HACS rules) may be applied across all translation files.

### Coding Principles

Expand Down
3 changes: 2 additions & 1 deletion custom_components/polleninformation/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
PollenApiError,
async_get_pollenat_data,
)
from .const import DEFAULT_LANG, DOMAIN
from .const import API_KEY_REQUEST_URL, DEFAULT_LANG, DOMAIN
from .options_flow import OptionsFlowHandler
from .utils import (
async_get_country_code_from_latlon,
Expand Down Expand Up @@ -285,6 +285,7 @@ async def async_step_user(self, user_input=None):
step_id="user",
data_schema=data_schema,
errors=errors,
description_placeholders={"api_key_url": API_KEY_REQUEST_URL},
)

@staticmethod
Expand Down
5 changes: 5 additions & 0 deletions custom_components/polleninformation/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
DEFAULT_NAME = "Polleninformation"
DEFAULT_APIKEY = "" # Empty by default; must be set by user

# URL for requesting an API key
API_KEY_REQUEST_URL = (
"https://www.polleninformation.at/en/data-interface/request-an-api-key"
)

# API URL for polleninformation.at (new structure)
POLLENAT_API_URL = (
"https://www.polleninformation.at/api/forecast/public"
Expand Down
9 changes: 2 additions & 7 deletions custom_components/polleninformation/options_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from homeassistant import config_entries
from homeassistant.helpers.selector import LocationSelector, LocationSelectorConfig

from .const import DEFAULT_LANG
from .const import API_KEY_REQUEST_URL, DEFAULT_LANG
from .utils import async_get_country_options, async_get_language_options

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -81,11 +81,6 @@ async def async_step_init(self, user_input=None):
}
)

api_key_info = (
"An API key is required for polleninformation.at. "
"You can request an API key at: https://www.polleninformation.at/en/data-interface/request-an-api-key"
)

if user_input is not None:
country_code = user_input.get("country")
lang_code = user_input.get("language")
Expand Down Expand Up @@ -159,5 +154,5 @@ async def async_step_init(self, user_input=None):
step_id="init",
data_schema=data_schema,
errors=errors,
description_placeholders={"api_key_info": api_key_info},
description_placeholders={"api_key_url": API_KEY_REQUEST_URL},
)
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Standortname (optional)",
"apikey": "API-Schlüssel"
},
"description": "Wählen Sie das Land und den Ort, für den Sie die Pollenprognose überwachen möchten, sowie die Sprache, in der Ihre Sensoren konfiguriert werden sollen. Sie benötigen einen API-Schlüssel für polleninformation.at. Beantragen Sie diesen unter: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Wählen Sie das Land und den Ort, für den Sie die Pollenprognose überwachen möchten, sowie die Sprache, in der Ihre Sensoren konfiguriert werden sollen. Sie benötigen einen API-Schlüssel für polleninformation.at. Beantragen Sie diesen unter: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"step": {
"user": {
"title": "Add Pollen Information",
"description": "Select the country and location where you want to monitor the pollen forecast and the language you want your sensors configured as. You need an API key for polleninformation.at. Request it at: https://www.polleninformation.at/en/data-interface/request-an-api-key",
"description": "Select the country and location where you want to monitor the pollen forecast and the language you want your sensors configured as. You need an API key for polleninformation.at. Request it at: {api_key_url}",
"data": {
"country": "Country",
"location": "Location (select on map)",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Nombre de la ubicación (opcional)",
"apikey": "Clave API"
},
"description": "Seleccione el país y la ubicación donde desea monitorear el pronóstico de polen y el idioma en el que desea configurar sus sensores. Necesita una clave API de polleninformation.at. Solicítela en: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Seleccione el país y la ubicación donde desea monitorear el pronóstico de polen y el idioma en el que desea configurar sus sensores. Necesita una clave API de polleninformation.at. Solicítela en: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Sijainnin nimi (valinnainen)",
"apikey": "API-avain"
},
"description": "Valitse maa ja sijainti, josta haluat seurata siitepölyennustetta, sekä kieli, jolla sensorit määritetään. Tarvitset API-avaimen palvelusta polleninformation.at. Pyydä avain täältä: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Valitse maa ja sijainti, josta haluat seurata siitepölyennustetta, sekä kieli, jolla sensorit määritetään. Tarvitset API-avaimen palvelusta polleninformation.at. Pyydä avain täältä: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Nom de l'emplacement (optionnel)",
"apikey": "Clé API"
},
"description": "Sélectionnez le pays et l'emplacement pour lesquels vous souhaitez surveiller les prévisions de pollen, ainsi que la langue souhaitée pour vos capteurs. Vous avez besoin d'une clé API pour polleninformation.at. Demandez-la ici : https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Sélectionnez le pays et l'emplacement pour lesquels vous souhaitez surveiller les prévisions de pollen, ainsi que la langue souhaitée pour vos capteurs. Vous avez besoin d'une clé API pour polleninformation.at. Demandez-la ici : {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Helyszín neve (opcionális)",
"apikey": "API-kulcs"
},
"description": "Válassza ki az országot és a helyszínt, ahol figyelni szeretné a pollenjósltat, valamint a szenzorok beállításához kívánt nyelvet. Szüksége van egy API-kulcsra a polleninformation.at-hez. Igényelje itt: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Válassza ki az országot és a helyszínt, ahol figyelni szeretné a pollenjósltat, valamint a szenzorok beállításához kívánt nyelvet. Szüksége van egy API-kulcsra a polleninformation.at-hez. Igényelje itt: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Nome posizione (opzionale)",
"apikey": "Chiave API"
},
"description": "Seleziona il paese e la località per cui vuoi monitorare la previsione dei pollini e la lingua in cui configurare i tuoi sensori. È necessaria una chiave API per polleninformation.at. Richiedila qui: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Seleziona il paese e la località per cui vuoi monitorare la previsione dei pollini e la lingua in cui configurare i tuoi sensori. È necessaria una chiave API per polleninformation.at. Richiedila qui: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Vietos pavadinimas (neprivaloma)",
"apikey": "API raktas"
},
"description": "Pasirinkite šalį ir vietą, kurioje norite stebėti žiedadulkių prognozę, bei kalbą, kuria bus konfigūruojami jutikliai. Jums reikia API rakto iš polleninformation.at. Prašykite čia: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Pasirinkite šalį ir vietą, kurioje norite stebėti žiedadulkių prognozę, bei kalbą, kuria bus konfigūruojami jutikliai. Jums reikia API rakto iš polleninformation.at. Prašykite čia: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/lv.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Vietas nosaukums (nav obligāts)",
"apikey": "API atslēga"
},
"description": "Izvēlieties valsti un atrašanās vietu, kur vēlaties uzraudzīt ziedputekšņu prognozi, un valodu, kādā konfigurēt sensorus. Jums ir nepieciešama API atslēga no polleninformation.at. Pieprasiet to šeit: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Izvēlieties valsti un atrašanās vietu, kur vēlaties uzraudzīt ziedputekšņu prognozi, un valodu, kādā konfigurēt sensorus. Jums ir nepieciešama API atslēga no polleninformation.at. Pieprasiet to šeit: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Nazwa lokalizacji (opcjonalnie)",
"apikey": "Klucz API"
},
"description": "Wybierz kraj i lokalizację, dla których chcesz monitorować prognozę pyłków oraz język, w jakim mają być skonfigurowane czujniki. Potrzebujesz klucza API do polleninformation.at. Złóż wniosek tutaj: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Wybierz kraj i lokalizację, dla których chcesz monitorować prognozę pyłków oraz język, w jakim mają być skonfigurowane czujniki. Potrzebujesz klucza API do polleninformation.at. Złóż wniosek tutaj: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Nome da localização (opcional)",
"apikey": "Chave API"
},
"description": "Selecione o país e a localização onde pretende monitorizar a previsão do pólen e o idioma para configurar os sensores. É necessária uma chave API do polleninformation.at. Solicite-a em: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Selecione o país e a localização onde pretende monitorizar a previsão do pólen e o idioma para configurar os sensores. É necessária uma chave API do polleninformation.at. Solicite-a em: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Название местоположения (необязательно)",
"apikey": "API-ключ"
},
"description": "Выберите страну и местоположение, для которых вы хотите отслеживать прогноз пыльцы, а также язык настройки ваших датчиков. Необходим API-ключ для polleninformation.at. Запросите его здесь: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Выберите страну и местоположение, для которых вы хотите отслеживать прогноз пыльцы, а также язык настройки ваших датчиков. Необходим API-ключ для polleninformation.at. Запросите его здесь: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/sk.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Názov lokality (voliteľné)",
"apikey": "API kľúč"
},
"description": "Vyberte krajinu a miesto, kde chcete sledovať predpoveď peľu, a jazyk, v ktorom chcete nastaviť senzory. Potrebujete API kľúč z polleninformation.at. Požiadajte oň tu: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Vyberte krajinu a miesto, kde chcete sledovať predpoveď peľu, a jazyk, v ktorom chcete nastaviť senzory. Potrebujete API kľúč z polleninformation.at. Požiadajte oň tu: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Platsnamn (valfritt)",
"apikey": "API-nyckel"
},
"description": "Välj land och plats där du vill övervaka pollenprognosen samt det språk du vill ha dina sensorer på. Du behöver en API-nyckel för polleninformation.at. Begär den på: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Välj land och plats där du vill övervaka pollenprognosen samt det språk du vill ha dina sensorer på. Du behöver en API-nyckel för polleninformation.at. Begär den på: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Konum adı (isteğe bağlı)",
"apikey": "API anahtarı"
},
"description": "Polen tahminini izlemek istediğiniz ülkeyi ve konumu, ayrıca sensörlerinizi yapılandırmak istediğiniz dili seçin. polleninformation.at için bir API anahtarına ihtiyacınız var. Şuradan talep edin: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Polen tahminini izlemek istediğiniz ülkeyi ve konumu, ayrıca sensörlerinizi yapılandırmak istediğiniz dili seçin. polleninformation.at için bir API anahtarına ihtiyacınız var. Şuradan talep edin: {api_key_url}"
}
},
"error": {
Expand Down
2 changes: 1 addition & 1 deletion custom_components/polleninformation/translations/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"location_name": "Назва місця (необов’язково)",
"apikey": "API-ключ"
},
"description": "Виберіть країну та місце, для яких ви хочете відстежувати прогноз пилку, а також мову для налаштування датчиків. Вам потрібен API-ключ для polleninformation.at. Запросіть його тут: https://www.polleninformation.at/en/data-interface/request-an-api-key"
"description": "Виберіть країну та місце, для яких ви хочете відстежувати прогноз пилку, а також мову для налаштування датчиків. Вам потрібен API-ключ для polleninformation.at. Запросіть його тут: {api_key_url}"
}
},
"error": {
Expand Down