Compare commits

..

1 Commits

Author SHA1 Message Date
FigurinePanda43 e25a95277c
Merge 58b9da9b80 into 55652415f4 2026-02-03 17:51:26 +01:00
5 changed files with 12 additions and 35 deletions

View File

@ -86,7 +86,7 @@ class WeatherDataUpdateCoordinator(DataUpdateCoordinator):
raise HTTPUnauthorized raise HTTPUnauthorized
if self.config_entry.options.get(WINDY_ENABLED): if self.config_entry.options.get(WINDY_ENABLED):
_ = await self.windy.push_data_to_windy(data, _wslink) response = await self.windy.push_data_to_windy(data, _wslink)
if self.config.options.get(POCASI_CZ_ENABLED): if self.config.options.get(POCASI_CZ_ENABLED):
await self.pocasi.push_data_to_server(data, "WSLINK" if _wslink else "WU") await self.pocasi.push_data_to_server(data, "WSLINK" if _wslink else "WU")

View File

@ -197,19 +197,13 @@ class ConfigOptionsFlowHandler(OptionsFlow):
errors=errors, errors=errors,
) )
station_id = (user_input.get(WINDY_STATION_ID) or "").strip() if (user_input[WINDY_ENABLED] is True) and ((user_input[WINDY_STATION_ID] == "") or (user_input[WINDY_STATION_PW] == "")):
station_pw = (user_input.get(WINDY_STATION_PW) or "").strip() errors[WINDY_STATION_ID] = "windy_key_required"
if user_input.get(WINDY_ENABLED): return self.async_show_form(
if not station_id: step_id="windy",
errors[WINDY_STATION_ID] = "windy_id_required" data_schema=vol.Schema(self.windy_data_schema),
if not station_pw: errors=errors,
errors[WINDY_STATION_PW] = "windy_pw_required" )
if errors:
return self.async_show_form(
step_id="windy",
data_schema=vol.Schema(self.windy_data_schema),
errors=errors,
)
# retain user_data # retain user_data
user_input.update(self.user_data) user_input.update(self.user_data)

View File

@ -29,8 +29,7 @@
"valid_credentials_api": "Vyplňte platné API ID", "valid_credentials_api": "Vyplňte platné API ID",
"valid_credentials_key": "Vyplňte platný API KEY", "valid_credentials_key": "Vyplňte platný API KEY",
"valid_credentials_match": "API ID a API KEY nesmějí být stejné!", "valid_credentials_match": "API ID a API KEY nesmějí být stejné!",
"windy_id_required": "Je vyžadováno Windy ID, pokud chcete aktivovat přeposílání dat na Windy", "windy_key_required": "Je vyžadován Windy API key, pokud chcete aktivovat přeposílání dat na Windy",
"windy_pw_required": "Je vyžadován Windy KEY, pokud chcete aktivovat přeposílání dat na Windy",
"pocasi_id_required": "Je vyžadován Počasí ID, pokud chcete aktivovat přeposílání dat na Počasí Meteo CZ", "pocasi_id_required": "Je vyžadován Počasí ID, pokud chcete aktivovat přeposílání dat na Počasí Meteo CZ",
"pocasi_key_required": "Klíč k účtu Počasí Meteo je povinný.", "pocasi_key_required": "Klíč k účtu Počasí Meteo je povinný.",
"pocasi_send_minimum": "Minimální interval pro přeposílání je 12 sekund." "pocasi_send_minimum": "Minimální interval pro přeposílání je 12 sekund."

View File

@ -29,8 +29,7 @@
"valid_credentials_api": "Provide valid API ID.", "valid_credentials_api": "Provide valid API ID.",
"valid_credentials_key": "Provide valid API KEY.", "valid_credentials_key": "Provide valid API KEY.",
"valid_credentials_match": "API ID and API KEY should not be the same.", "valid_credentials_match": "API ID and API KEY should not be the same.",
"windy_id_required": "Windy API key is required if you want to enable this function.", "windy_key_required": "Windy API key is required if you want to enable this function."
"windy_pw_required": "Windy API password is required if you want to enable this function."
}, },
"step": { "step": {
"init": { "init": {

View File

@ -5,7 +5,6 @@ import logging
from aiohttp.client_exceptions import ClientError from aiohttp.client_exceptions import ClientError
from homeassistant.components import persistent_notification
from homeassistant.config_entries import ConfigEntry from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession from homeassistant.helpers.aiohttp_client import async_get_clientsession
@ -139,22 +138,8 @@ class WindyPush:
if "t1solrad" in purged_data: if "t1solrad" in purged_data:
purged_data["solarradiation"] = purged_data.pop("t1solrad") purged_data["solarradiation"] = purged_data.pop("t1solrad")
windy_station_id = self.config.options.get(WINDY_STATION_ID, "") windy_station_id = self.config.options.get(WINDY_STATION_ID)
windy_station_pw = self.config.options.get(WINDY_STATION_PW, "") windy_station_pw = self.config.options.get(WINDY_STATION_PW)
if windy_station_id == "" or windy_station_pw == "":
_LOGGER.error(
"Windy ID or PASSWORD is not set correctly. Please reconfigure your WINDY resend credentials. Disabling WINDY resend for now!"
)
persistent_notification.async_create(
self.hass,
"Your Windy credentials are not set correctly. Disabling Windy resending for now. Update Windy options and enable reseding.",
"Windy resending disabled.",
)
await update_options(self.hass, self.config, WINDY_ENABLED, False)
return False
request_url = f"{WINDY_URL}" request_url = f"{WINDY_URL}"